【问题标题】:Rails works briefly but then uninstalls itself and says it's not currently installed on this systemRails 短暂工作,但随后自行卸载并说它当前未安装在此系统上
【发布时间】:2015-01-05 09:52:39
【问题描述】:

superuser 上的帖子类似,我使用installrails.com 成功设置了我的 ruby​​ on rails 环境。我已经能够创建一个basic rails application 并部署到heroku,但是每次我退出终端然后返回并尝试启动我的本地服务器时,我都会收到以下消息:

$ rails s
Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

所以我尝试使用以下命令重新安装 rails:

gem install rails

并收到此错误消息:

dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
  Referenced from: /Users/bparman/.rvm/rubies/ruby-2.1.4/bin/ruby
  Reason: image not found

所以我尝试重新安装并按照这些文章中的说明进行操作:Ruby installation issues with RVMRails keeps telling me that it's not currently installed。同样,这些工作很短暂,我能够更新我的应用程序,将其部署到 Heroku 等,但 10 分钟后回来并收到此错误消息:

Rails is not currently installed on this system.

这是我的 ruby​​ 安装:

$ rvm list

rvm rubies

=> ruby-2.1.3 [ x86_64 ]
 * ruby-2.1.4 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

这是我的宝石:

$ rvm gemset list_all

gemsets for ruby-2.1.3 (found in /Users/bparman/.rvm/gems/ruby-2.1.3)
=> (default)
   global


gemsets for ruby-2.1.4 (found in /Users/bparman/.rvm/gems/ruby-2.1.4)
=> (default)
   global

同样,只要我按照说明进行操作,它就会重新安装,但稍后会说它没有安装。

【问题讨论】:

  • 您可以在一个 gemset 中安装导轨并使用其他的
  • 你确定你在运行 RVM 的 rails 吗?退出终端,打开新会话('rails' 命令不起作用)并调用ruby -v 进行检查。
  • 当我这样做时,我得到ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]

标签: ruby-on-rails rvm osx-mavericks


【解决方案1】:

dyld: Library not loaded 消息让我觉得你的红宝石可能有一个过时的 libgmp 自制版本。

或许可以试试

> brew update
> brew install gmp 
> rvm reinstall 2.1.4 --disable-binary

【讨论】:

  • 我试过这个,它再次工作了一段时间。大约一个小时后,我收到了Rails is not currently installed on this system.,我创建了一个虚拟机并使用与以前相同的设置,没有在那里遇到问题。我可能会尝试摆脱我安装的所有内容并重新开始。
【解决方案2】:

我遇到了类似的问题,结果发现没有一个教程涉及 bash 配置文件设置,这就是为什么当您迁移到 VM 并重新进行它的工作时。

我只需要在 bash 配置文件中设置 RVM 的源代码就花了很长时间才弄明白。

echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile

重启终端和机器。再也不会出错了!!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-21
    • 2013-06-10
    • 1970-01-01
    • 2015-06-04
    • 2017-07-04
    • 1970-01-01
    • 2017-01-19
    相关资源
    最近更新 更多