0

我碰到下面的錯誤,當我嘗試打開軌道控制檯:Rails的控制檯登錄失敗

$ rails console 
/home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- minitest/unit (LoadError) 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /usr/share/ruby/test/unit/assertions.rb:1:in `<top (required)>' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /usr/share/ruby/test/unit/testcase.rb:1:in `<top (required)>' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/test_case.rb:1:in `<top (required)>' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/console/app.rb:2:in `<top (required)>' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:304:in `initialize_console' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:152:in `load_console' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands/console.rb:27:in `start' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start' 
from /home/me/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>' 
from script/rails:6:in `require' 
from script/rails:6:in `<main>' 

我使用Fedora 17,我已經通過yum安裝Ruby和寶石,然後通過導軌寶石。

更新: 我安裝的寶石,也許有一些寶石在我的寶石缺失或我有它的假版本。

$ gem list 
*** LOCAL GEMS *** 

actionmailer (3.2.13) 
actionpack (3.2.13) 
activemodel (3.2.13) 
activerecord (3.2.13) 
activeresource (3.2.13) 
activesupport (3.2.13) 
arel (3.0.2) 
builder (3.0.4) 
bundler (1.3.4) 
coffee-rails (3.2.2) 
coffee-script (2.2.0) 
coffee-script-source (1.6.2) 
erubis (2.7.0) 
execjs (1.4.0) 
hike (1.2.1) 
i18n (0.6.1) 
journey (1.0.4) 
jquery-rails (2.2.1) 
json (1.7.7) 
mail (2.5.3) 
mime-types (1.22) 
minitest (4.7.0) 
multi_json (1.7.2) 
polyglot (0.3.3) 
rack (1.4.5) 
rack-cache (1.2) 
rack-ssl (1.3.3) 
rack-test (0.6.2) 
rails (3.2.13) 
railties (3.2.13) 
rake (10.0.4) 
rdoc (3.12.2) 
sass (3.2.7) 
sass-rails (3.2.6) 
sprockets (2.2.2) 
thor (0.18.1) 
tilt (1.3.6) 
treetop (1.4.12) 
tzinfo (0.3.37) 
uglifier (1.3.0) 
+0

嘗試安裝'minitest'寶石:'$創業板安裝minitest'。 –

+0

我試過了,錯誤依然存在。 – Ragadabing

+0

你確定你使用的是同一個寶石嗎? – Geo

回答

0

好吧,我已經通過手動安裝ruby 2.0.0和刪除了我通過yum安裝的ruby 1.9.3來解決了這個問題。

0

試圖通過運行:

script/rails console 

,讓我們知道發生了什麼,否則你也可以嘗試

bundle exec script/rails console 
+0

與上面相同的錯誤信息發生... – Ragadabing

0

很奇怪是在控制檯中加載測試的... minitest gem可能只包含在測試組中,並且在開發環境中不可用。將寶石添加到開發小組可能會起作用,但這是治療症狀,而不是原因。

不知何故,也許在一個irbrc文件中,您包含測試庫。

0
group :development, :test do 
    gem 'test-unit' 
end 

和運行

bundle 

固定我的問題。

在你的情況,你可能要包括 'MINITEST'