遗留应用程序的宝石依赖问题

时间:2013-01-29 15:59:06

标签: ruby-on-rails ruby

我继承了一个rails 2.2应用程序,但是在使我的本地环境以允许我工作的方式配置时遇到了一些麻烦。启动WEBrick会给我以下错误:

./script/server
=> Booting WEBrick...
/Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/gem_dependency.rb:224:in `specification': undefined method `version_requirements=' for #<Gem::Dependency:0x10b1ec6a0> (NoMethodError)
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `plugins'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `inject'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `each'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `inject'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:63:in `locate_plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:62:in `map'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:62:in `locate_plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:27:in `all_plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:22:in `plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:45:in `add_plugin_load_paths'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/initializer.rb:269:in `add_plugin_load_paths'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/initializer.rb:135:in `process'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
from /Users/swachtma/htdocs/skating_circle/config/environment.rb:20
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `gem_original_require'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/commands/servers/webrick.rb:59
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `gem_original_require'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371@skating/gems/rails-2.2.2/lib/commands/server.rb:49
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `gem_original_require'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `require'
from ./script/server:3

我怀疑我可能需要降级我的ruby-gems版本,但我不知道如何确定和适当的版本。

These are my local gems:

*** LOCAL GEMS ***

actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
aws-s3 (0.6.3)
builder (3.1.4)
bundler (1.2.3)
contacts (1.2.4)
diff-lcs (1.1.3)
fastercsv (1.5.5)
gdata (1.1.1)
heywatch (1.2.0)
highline (1.6.15)
hoptoad_notifier (2.4.11)
hpricot (0.8.6)
json (1.7.6)
mime-types (1.19)
mini_magick (3.4)
net-ssh (2.6.3)
rack (1.5.1)
rails (2.2.2)
rake (10.0.3, 0.8.7)
rest-client (1.6.7)
rspec (2.12.0, 1.3.2)
rspec-core (2.12.2, 2.6.4)
rspec-expectations (2.12.1, 2.6.0)
rspec-mocks (2.12.2, 2.6.0)
rspec-rails (1.3.2)
rubygems-bundler (1.1.0)
rubygems-update (1.4.2)
rvideo (0.9.3)
rvm (1.11.3.6)
subexec (0.2.2)
will_paginate (2.2.2)
xml-simple (1.1.2)

2 个答案:

答案 0 :(得分:4)

对于Rails 2.2宝石版1.4.2的工作原理我猜。尝试降级到1.4.2

  sudo gem update --system 1.4.2 or rvm install rubygems 1.4.2

答案 1 :(得分:1)

试试这个

gem install rubygems-update -v='1.4.2'
gem uninstall rubygems-update -v='1.5.0'
update_rubygems

另外,请参阅以下问题:

Gem dependency error in rails 2.3.4

ruby on rails: undefined method "version_requirements' when attempting to start server after new install