我在 Amazon EC2 上托管了一个 Ruby on Rails 应用程序。我正在使用 Java SSH 客户端连接实例。当我进入我在 Amazon 上的工作目录并尝试输入时,rails c
它显示错误require': cannot load such file -- minitest/unit (LoadError)
。我不知道为什么我无法访问 rails 控制台。
/usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- minitest/unit (LoadError)
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/test/unit/assertions.rb:1:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/test/unit/testcase.rb:1:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/test_case.rb:1:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/console/app.rb:2:in `<top (required)>'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby/1.9/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:304:in `initialize_console'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:152:in `load_console'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:27:in `start'
from /usr/share/ruby/1.9/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /usr/share/ruby/1.9/gems/1.9.1/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>'
我试图通过安装来解决这个错误,gem install minitest-rails
但它抛出了错误
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/share/ruby/1.9/gems/1.9.1 directory.
我尝试在我的 gemfile 中添加两个 gem gem 'turn' , '< 0.8.3'
,gem 'minitest-rails
然后推送到 AWS 但没有得到任何东西。
如何摆脱这个错误。我想访问我的 rails 控制台。请帮忙。提前致谢。