Gem dependency error in rails 2.3.4

HI, I work in Rails .. my list of gems

*** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.4, 3.0.3, 2.3.11, 2.3.10, 2.3.8, 2.3.4, 2.3.2) actionpack (3.0.4, 3.0.3, 2.3.11, 2.3.10, 2.3.8, 2.3.4, 2.3.2) activemodel (3.0.4, 3.0.3) activerecord (3.0.4, 3.0.3, 2.3.11, 2.3.10, 2.3.8, 2.3.4) activeresource (3.0.4, 3.0.3, 2.3.11, 2.3.10, 2.3.8, 2.3.4) activesupport (3.0.4, 3.0.3, 2.3.11, 2.3.10, 2.3.8, 2.3.4, 2.3.2) acts-as-taggable-on (2.0.6) acts_as_ferret (0.4.8, 0.4.2) acts_as_versioned (0.6.0) after_commit (1.0.8, 1.0.7) annotate (2.4.0) annotate-models (1.0.4) arel (2.0.8, 2.0.7, 2.0.6) autotest-rails (4.1.0) babosa (0.2.1, 0.2.0) bcrypt-ruby (2.1.4, 2.1.3, 2.1.2) builder (3.0.0, 2.1.2) bundler (1.0.10, 1.0.7) cgi_multipart_eof_fix (2.5.0) ClothRed (0.4.1) coderay (0.9.6, 0.9.5, 0.9.3, 0.8.357) configuration (1.1.0) cucumber (0.8.5) daemons (1.1.0, 1.0.10) delayed_job (2.1.2, 2.0.5, 2.0.4, 2.0.3) devise (1.1.5) diff-lcs (1.1.2) docsplit (0.5.0) echoe (4.3.1, 3.0.2) erubis (2.6.6) factory_girl (1.3.2, 1.2.3) fastthread (1.0.7, 1.0.1) ferret (0.11.6) friendly_id (3.2.0) gem_plugin (0.2.3) gemcutter (0.6.1) gherkin (2.2.0, 2.1.5) gm (1.0.4) haml (3.0.25) highline (1.6.1, 1.5.0) hoe (2.6.1, 1.12.2) hpricot (0.8.3, 0.8.2, 0.8.1) htmldoc (0.2.3, 0.2.1) i18n (0.5.0) io-reactor (1.0.4) jquery-rails (0.2.6) jslint_on_rails (1.0.5) json_pure (1.4.6, 1.4.3) launchy (0.3.7, 0.3.5) mail (2.2.15, 2.2.14, 2.2.13) memcache-client (1.8.5) memcached (1.0.6) mime-types (1.16) mini_magick (1.3.2, 1.2.3) mocha (0.9.10) mongrel (1.1.5) mysql (2.8.1) mysql2 (0.2.6) net-ldap (0.1.1) newgem (1.5.3, 1.3.0) oauth (0.4.4, 0.4.1, 0.3.6, 0.3.2) oauth-plugin (0.3.14) paperclip (2.3.8) passenger (2.2.15, 2.2.5, 2.1.2, 2.0.6) pg (0.9.0, 0.8.0) polyglot (0.3.1) prawn (0.8.4) prawn-core (0.8.4) prawn-format (0.2.3) prawn-js (0.7.1) prawn-layout (0.8.4) prawn-security (0.8.4) rack (1.2.1, 1.1.0, 1.0.1, 0.9.1) rack-mount (0.6.13) rack-test (0.5.7) rails (3.0.4, 2.3.11, 2.3.8, 2.3.4) railties (3.0.4, 3.0.3) rake (0.8.7, 0.8.4, 0.8.1) RedCloth (4.2.3, 4.1.1) riddle (1.2.2, 1.2.1, 1.0.12) rspec (1.3.0) rspec-rails (1.3.2) rubigen (1.5.5, 1.5.2) ruby-hmac (0.4.0, 0.3.2) Ruby-MemCache (0.0.1) rubyforge (2.0.4, 1.0.3, 1.0.1) rubygems-update (1.4.2) slim_scrooge (1.0.11) sqlite3-ruby (1.3.2, 1.3.1, 1.2.5, 1.2.4) subexec (0.0.4) syntax (1.0.0) term-ansicolor (1.0.5) thinking-sphinx (1.4.1, 1.4.0, 1.3.18) thor (0.14.6) treetop (1.4.9) trollop (1.16.2) ts-delayed-delta (1.1.1, 1.1.0) tzinfo (0.3.24, 0.3.23) warden (1.0.3, 1.0.2) web-app-theme (0.6.3) will_paginate (3.0.pre2) yaml_db (0.2.0) ZenTest (4.3.3) 

I have a list of gems

When i run the application

  script/server => Booting Mongrel => Rails 2.3.4 application starting on http://0.0.0.0:3000 /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:in `requirement': undefined local variable or method `version_requirements' for #<Rails::GemDependency:0xb7181c78> (NameError) from /usr/local/lib/site_ruby/1.8/rubygems.rb:254:in `activate' from /usr/local/lib/site_ruby/1.8/rubygems.rb:1204:in `gem' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:73:in `add_load_paths' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:301:in `add_gem_load_paths' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:301:in `each' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:301:in `add_gem_load_paths' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:132:in `process' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from /home/user/application/config/environment.rb:19 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `require' from script/server:3 

I get the error above.

How to resolve this?

+4
source share
6 answers

This is because you installed RubyGems, which is too large for your version of Rails. Either downgrade (and run update_rubygems again), or upgrade Rails to version 2.3.11.

+13
source

The solution is pretty simple. Just run the following commands to revert to the previous version of rubygems, and you should be fine:

 $ gem install rubygems-update -v='1.4.2' $ gem uninstall rubygems-update -v='1.5.0' $ update_rubygems 
+10
source

This may be due to the fact that you installed rails 3, but trying to run the rails 2.3.4 application. I had this problem before, and the solution was to remove rails 3 because this dependency is one of rails 3, not 2.3.4

+3
source

The gem list (the one you get in the gem list command) is a list of gems installed.

This is not a list of gems used by your application -> those found in the Gemfile.

What you can try or have tried:

  • update_rubygems
  • install package

(see also https://gist.github.com/807008 )

+2
source

I know there is already an answer for this, but when I was working with older rails, I set up the script / server webrick after you had the same problem and it worked. However, this may not be ideal for production, and I recommend updating as indicated in another answer.

0
source

OK I just upgraded the Rails application from 2.3.4 to 2.3.14 and got the same error.

However, I have already lowered the rating of rubigems to 1.3.5 (as recommended in another answer) in order to circumvent a similar error after updating the main Ruby package

So, I took a punt and updated it to the latest version:

 sudo gem update --system 

This gave me version 1.8.24

and it all worked again. shrug

Perhaps this poses a problem in a slightly different light.

0
source

Source: https://habr.com/ru/post/1340609/


All Articles