我有ruby版本2.0.0p451
和rails版本3.2.13
。我运行了bundle install并安装了所有gem。当我尝试rails s命令时,我收到以下错误:
这个问题似乎与authlogic有关。我卸载它,服务器启动正常。有什么想法吗?
/usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- scrypt (LoadError)
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/2.0.0/bundler/gems/authlogic-f19ff3a9eb88/lib/authlogic/crypto_providers/scrypt.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/2.0.0/bundler/gems/authlogic-f19ff3a9eb88/lib/authlogic.rb:60:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/bundler/gems/authlogic-f19ff3a9eb88/lib/authlogic.rb:59:in `each'
from /usr/local/lib/ruby/gems/2.0.0/bundler/gems/authlogic-f19ff3a9eb88/lib/authlogic.rb:59:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `block in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.1/lib/bundler.rb:132:in `require'
from /home/superq/quizot/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
当我尝试打开控制台时,这就是我得到的:
/usr/local/lib/ruby/2.0.0/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
from /usr/local/lib/ruby/2.0.0/irb/completion.rb:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands/console.rb:3:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands/console.rb:3:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:38:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:38:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我已经卸载了ruby,rails并安装了几次。似乎没有什么工作。有什么想法吗?
我只有一个rails应用程序,在这台机器上永远不需要另一个rails应用程序。所有安装的gem仅适用于此应用程序。它工作正常,但我的硬盘崩溃,现在我正在尝试在新的硬盘驱动器上设置相同的应用程序。
答案 0 :(得分:5)
在更新为authlogic-3.4.1时,scrypt和bcrypt出现了同样的错误
我的解决方案是将scrypt gem添加到我的gemfile中:
gem 'authlogic', '~> 3.4.1'
gem 'bcrypt', '~> 3.1.7'
gem 'scrypt', '1.2.1'
答案 1 :(得分:1)
您的ruby安装很可能不会针对readline
开发标头进行编译。尝试将其添加到Gemfile
:
gem 'rb-readline'
这会将readline的纯ruby实现添加到您的应用程序中,而不是它期望编译的版本。
答案 2 :(得分:0)
您应该使用以下命令安装ruby readline:
gem install rb-readline