-1

我从网上尝试了很多不同的解决方案,但我无法解决这个问题。这是我在执行 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>'
4

3 回答 3

0

假设您已正确安装了 opensll - 您应该通过重新安装来检查,这听起来像是与 RVM 相关的问题。最糟糕的是我会尝试重新安装 RVM(这有点麻烦)

于 2013-02-02T02:54:45.547 回答
0

使用 RVM 创建 gemset

rvm gemset create gemset_name

然后运行

bundle install

这实际上是 gem 依赖的问题。

于 2013-02-02T07:51:58.843 回答
0

这些是我执行的步骤,它对我有用。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
于 2013-02-02T18:12:13.120 回答