Ruby Gem Version Error
I'm not able to script/console to my rails app after upgrading from ubuntu 9.10 to 10.04
# gem list
*** LOCAL GEMS ***
aaronh-chronic (0.3.9)
abstract (1.0.0)
actionmailer (3.0.5, 2.3.10, 2.3.5)
actionpack (3.0.5, 3.0.3, 2.3.10, 2.3.5)
activemerchant (1.12.0, 1.9.0)
activemodel (3.0.5, 3.0.3, 3.0.1)
activerecord (3.0.5, 2.3.11, 2.3.10, 2.3.5)
activeresource (3.0.5, 2.3.10, 2.3.5)
activesupport (3.0.5, 3.0.3, 3.0.1, 2.3.11, 2.3.10, 2.3.5)
addressable (2.2.4)
after_commit (1.0.8)
ambethia-smtp-tls (1.1.2)
arel (2.0.9, 1.0.1)
authlogic (2.1.6)
braintree (2.8.0, 2.6.1)
builder (3.0.0, 2.1.2)
bundler (1.0.10)
cancan (1.4.0)
capistrano (2.5.19)
crack (0.1.8)
daemon_controller (0.2.6, 0.2.5)
erubis (2.6.6)
exception_notification (2.3.3.0)
faraday (0.5.7)
faraday_middleware (0.3.2)
fastthread (1.0.7)
file-tail (1.0.5)
hashie (1.0.0, 0.4.0)
highline (1.6.1)
hodel_3000_compliant_logger (0.1.0)
hoe (2.9.1, 2.6.2)
hominid (3.0.2, 2.2.0)
hpricot (0.8.4, 0.8.3)
httparty (0.7.4, 0.6.1)
i18n (0.5.0, 0.4.2)
json (1.5.1, 1.4.6)
json_pure (1.5.1, 1.4.6)
justinfrench-formtastic (0.2.4)
mail (2.2.15, 2.2.13)
mime-types (1.16)
minitest (2.0.2, 1.6.0)
mislav-will_paginate (2.3.11)
multi_json (0.0.5, 0.0.4)
multi_xml (0.2.1)
multipart-post (1.1.0)
mysql (2.8.1)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.1.3, 2.0.23)
net-ssh-gateway (1.0.1)
oauth (0.4.4, 0.4.3)
oink (0.1.2)
passenger (3.0.4, 3.0.0)
polyglot (0.3.1)
rack (1.2.1, 1.1.0, 1.0.1)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (2.3.10)
railties (3.0.5)
rake (0.8.7)
rdoc (3.5.3, 2.5.8)
riddle (1.2.2, 1.1.0)
rubyforge (2.0.4)
rubygems-update (1.5.2)
searchlogic (2.5.3, 2.4.27)
simple_oauth (0.1.4)
spruz (0.2.5, 0.1.5)
super_exception_notifier (3.0.13)
test-unit (2.2.0, 1.2.3)
thinking-sphinx (2.0.2, 1.3.20)
thor (0.14.6)
treetop (1.4.9)
twitter (1.1.2, 0.9.12)
tzinfo (0.3.24, 0.3.23)
whenever (0.6.6, 0.6.2)
# gem -v
1.5.2
# rails -v
Rails 2.3.10
# script/console
Loading development environment (Rails 2.3.10)
/usr/local/lib/site_ruby/1.9.1/r开发者_JAVA技巧ubygems.rb:779:in `report_activate_error':Gem::LoadError: RubyGem version error: rails(2.3.4 not = 2.3.10)
/usr/lib/ruby/1.9.1/irb/init.rb:264:in `require':LoadError: no such file to load -- console_app
/usr/lib/ruby/1.9.1/irb/init.rb:264:in `require':LoadError: no such file to load -- console_with_helpers
Any help is appreciated!
-Anshu
Your config/environment.rb
probably specifies RAILS_GEM_VERSION = '2.3.4'
which is why you're getting the rails(2.3.4 not = 2.3.10)
error message.
Either gem install rails -v=2.3.4
, or change your environment.rb
file to the correct version of Rails
The log suggests that there's a conflict between RubyGems and Rails. Try to reinstall rails gem.
- If you upgraded your system, I would suggest removing all gems (I recently followed this post to do so), as some natively compiled ones won't work in the new OS.
- Check that running
ruby -v
from your shell shows that you are using version 1.9.1, since it is looking for the gem for that Ruby version. - Check if there is an explicit Rails version number specified in
config/environment.rb
, or in yourGemfile
if you have one.
If you are on Ubuntu use rvm, it will save you a lot of trouble and allow you to safely play around with versions and dependencies....
slothistype
Same problem faced by me. So In before installation of any Gem and ruby, here I used rvm ie ruby version manager, which separates the different version of ruby from creating conflicts.
Click Here For RVM
精彩评论