ruby-on-rails - "script/server"RoR RVM错误

标签 ruby-on-rails rvm

在作者升级后,我正在使用 RVM 运行 RoR 应用程序。它提示我安装更高版本的 ruby​​:ruby-1.9.3-p448 而不是 ruby​​-1.8.7-p374,我是使用 RVM 安装的。

现在,当我运行 script/server 时,它会抛出此错误:

/home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-2.3.18/lib/active_support/inflector.rb:3:in '<top (required)>': iconv will be deprecated in the future, use String#encode instead.
=> Booting WEBrick
=> Rails 2.3.18 application starting on http://0.0.0.0:3000
/home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/rails-2.3.18/lib/rails/gem_dependency.rb:21:in 'add_frozen_gem_path': undefined method 'source_index' for Gem:Module (NoMethodError)
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/rails-2.3.18/lib/initializer.rb:298:in 'add_gem_load_paths'
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/rails-2.3.18/lib/initializer.rb:132:in 'process'
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/rails-2.3.18/lib/initializer.rb:113:in 'run'
    from /home/abcsoeasy/epz_lts-master/config/environment.rb:7:in '<top (required)>'
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in 'require'
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in 'block in require'
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in 'new_constants_in'
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in 'require'
    from /home/abcsoeasy/.rvm/gems/ruby-1.9.3-p448/gems/rails-2.3.18/lib/commands/server.rb:84:in '<top (required)>'
    from script/server:3:in 'require'
    from script/server:3:in '<main>'

请指导我。

最佳答案

您的 gem 版本导致了此问题。您需要将 gem 版本降级到 1.8.2x 才能解决此问题。或者您也可以降级您的 ruby​​ 版本。尝试使用 ruby​​ 1.9.3-p327,它在我的本地运行良好。希望这对您有帮助。

关于ruby-on-rails - "script/server"RoR RVM错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25638346/

相关文章:

ruby-on-rails - Rails 删除某些路线

ruby-on-rails - Rails - 如何获取 Assets 的文件路径(不是 url 路径)?

ruby - 无法使用 rvm 1.26.11 (OSX Yosemite) 安装 Ruby 2.3.0

ruby - Ansible 文件模块在尝试递归设置文件所有权时抛出错误

ruby - RVM + Zsh "RVM is not a function, selecting rubies with ' rvm 使用.. .' will not work"

ruby - 如何使用 rvm 和 ree 更新 ruby​​gems?

mysql - Rails - 按条件和限制排序?

ruby-on-rails - Elasticsearch 6.2.4 [400] {“error”:{“root_cause”:[{“type” :“illegal_argument_exception” ,“reason” :“text is empty (possibly HTTP/0.9)”}]

ruby-on-rails - "_form.erb.html"部分不适用于创建和更新表单代码生成

rvm - 为什么 Boxen 不能使用 RVM?