我正在努力将在Ubuntu上运行Rails 2.3.2的旧Rails应用程序升级到最新的Rails 2.3.15。该应用最初在vendor/rails
中有一个售卖版本的rails,但我删除了它,安装了rails 2.3.15
gem,并将config/environment.rb
中的版本号更改为:
RAILS_GEM_VERSION = '2.3.15' unless defined? RAILS_GEM_VERSION
重新启动应用程序后,我在mongrel日志中收到此错误消息(阻止应用程序启动):
/usr/local/lib/site_ruby/1.8/rubygems/version.rb:53:in `initialize': Malformed version number string (ArgumentError)
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/vendor_gem_source_index.rb:105:in `new'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/vendor_gem_source_index.rb:105:in `version_for_dir'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/vendor_gem_source_index.rb:47:in `refresh!'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/vendor_gem_source_index.rb:45:in `each'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/vendor_gem_source_index.rb:45:in `refresh!'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/vendor_gem_source_index.rb:29:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/gem_dependency.rb:21:in `new'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path'
... 17 levels...
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:19:in `load'
from /usr/bin/mongrel_rails:19
如何解决此错误需要做什么?
答案 0 :(得分:1)
我找到了问题的答案......
Rails期望只有vendor/gems
目录,但是那里有一个init.rb
文件试图将gems添加到加载路径(已经由Rails处理)。