我尝试了很多不同的web解决方案,但无法解决这个问题。这是我在执行rails 时遇到的错误
bash-3.2$ rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- openssl (LoadError)
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/session/cookie.rb:1:in `<top (required)>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/actionpack-3.2.11/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application/configuration.rb:140:in `const_get'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application/configuration.rb:140:in `session_store'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:273:in `block in default_middleware_stack'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:237:in `tap'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:237:in `default_middleware_stack'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/engine.rb:469:in `app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/sr027976/test_app/phappinfra_starter_app/config/environment.rb:5:in `<top (required)>'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:3:in `require'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:3:in `block in <main>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:in `new'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:in `<main>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/server.rb:200:in `app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/rack-1.4.4/lib/rack/server.rb:254:in `start'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374@phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
假设您已正确安装opensll(应该通过重新安装进行检查),这听起来像是一个与RVM相关的问题。最糟糕的是,我会尝试重新安装RVM(这有点麻烦)
使用RVM 创建宝石集
rvm gemset create gemset_name
然后运行
bundle install
这实际上就是gem依赖性的问题。
这些是我执行的步骤,对我来说很有效。rvm获取头
rvm requirements
rvm pkg remove
brew install libksba autoconf automake
rvm reinstall 1.9.2 --with-openssl-dir=/usr/local
rvm pkg install readline --verify-downloads 1
rvm use 1.9.3 --default