在作者升级后,我正在使用 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/