[英]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.