Rake因错误而中止:没有这样的文件要加载 - openssl

时间:2013-03-29 19:20:33

标签: ruby-on-rails ruby activerecord rvm bundler

我一直在Mac上遇到openssl问题。当我尝试发出rails任务时,我对错误消息感到非常困惑。可能是什么问题? 我的机器上肯定有openssl,因为当我在终端中键入它时,它会打开一个openSSL>会话。

每次尝试以下操作时:RAILS_ENV=development rake db:migrate 我收到以下错误:

rake aborted!
no such file to load -- openssl

(See full trace by running task with --trace)

当我使用--trace选项输入上述内容时,会显示下面列出的错误。

当我尝试通过键入rails s启动rails服务器时,我收到以下错误:

   $> rails s
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/openssl.rb:2:in `require': no such file to load -- openssl (LoadError)
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/openssl.rb:2:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:2:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/buffer.rb:2:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/algorithms.rb:1:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/algorithms.rb:1:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/session.rb:7:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh/transport/session.rb:7:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh.rb:10:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.6.6/lib/net/ssh.rb:10:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration/connections.rb:2:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration/connections.rb:2:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration.rb:5:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano/configuration.rb:5:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano.rb:3:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.14.2/lib/capistrano.rb:3:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
    from /Users/imtiazahmad/scripts/xxx-patchtrack/config/application.rb:7:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
    from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

1 个答案:

答案 0 :(得分:1)

尝试使用ssl支持重建ruby:

port install openssl +universal
rvm install 1.9.2 --with-openssl-dir=/opt/local