1

Rails 控制台在我的生产服务器上不起作用。这是发生的事情:

root@myapp:/webapps/myapp/current# rails c
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- rails/cli (LoadError)
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p180@rails/gems/rails-3.0.5/bin/rails:8:in `rescue in <main>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180@rails/gems/rails-3.0.5/bin/rails:3:in `<main>'

以前我收到与 Readline 相关的错误,在这里解释:Rails 控制台、RVM 和 readline 的问题

我尝试了 propsoed 修复,现在我没有收到 readline 错误。控制台仍然无法启动。

这是 rvm 信息输出:

ruby-1.9.3-p194:

  system:
    uname:       "Linux 111items 2.6.38-linode31 #1 SMP Mon Mar 21 21:22:33 UTC 2011 i686 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.13.4 () by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "53 minutes 38 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p194"
    date:         "2012-04-20"
    platform:     "i686-linux"
    patchlevel:   "2012-04-20 revision 35410"
    full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]"

  homes:
    gem:          "/usr/local/rvm/gems/ruby-1.9.3-p194"
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.3-p194"

  binaries:
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby"
    irb:          "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb"
    gem:          "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem"
    rake:         "/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin/rake"

  environment:
    PATH:         "/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    GEM_HOME:     "/usr/local/rvm/gems/ruby-1.9.3-p194"
    GEM_PATH:     "/usr/local/rvm/gems/ruby-1.9.3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global"
    MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

在本地,我总是能够启动 rails 控制台,但在远程机器上有些不同。

upd:到目前为止,我最好的猜测是 Rails 缺少“rails/cli”的正确路径。必须进行研究,看看如何解决这个问题。

4

2 回答 2

0

以普通用户身份安装 RVM 后,以普通用户身份重试。就我而言,以root
身份安装 RVM是一件痛苦的事,尤其是路径问题。

于 2012-05-15T09:43:48.467 回答
0

如果这不起作用,您可以随时切换到 rbenv。它更轻,并且在本地主机上拥有您需要的一切

于 2012-05-15T11:41:16.513 回答