[英]Ruby Gem Version Error
从ubuntu 9.10升级到10.04后,我无法在Rails应用中编写脚本/控制台
# 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/rubygems.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
任何帮助表示赞赏!
-安树
您的config/environment.rb
可能指定RAILS_GEM_VERSION = '2.3.4'
,这就是为什么您收到rails(2.3.4 not = 2.3.10)
错误消息的原因。
gem install rails -v=2.3.4
或将您的environment.rb
文件更改为正确的Rails版本
日志表明RubyGems和Rails之间存在冲突。 尝试重新安装Rails gem。
ruby -v
是否表明您正在使用版本1.9.1,因为它正在寻找该Ruby版本的gem。 config/environment.rb
或Gemfile
指定了明确的Rails版本号(如果Gemfile
话)。 如果您在Ubuntu上使用rvm,它将为您节省很多麻烦,并使您可以安全地使用版本和依赖项。
懒散型
我面临同样的问题。 因此,在安装任何宝石和红宝石之前,我在这里使用了rvm即红宝石版本管理器,该管理器将红宝石的不同版本与产生冲突分开。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.