-1

我已經嘗試了很多來自web的不同解決方案,我無法修復此問題。 這是我得到的錯誤,當我執行軌小號rails s不啓動我的項目

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/[email protected]_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/[email protected]_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/rack-1.4.4/lib/rack/session/cookie.rb:1:in `<top (required)>' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/actionpack-3.2.11/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/application/configuration.rb:140:in `const_get' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/application/configuration.rb:140:in `session_store' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/application.rb:273:in `block in default_middleware_stack' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/application.rb:237:in `tap' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/application.rb:237:in `default_middleware_stack' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/engine.rb:469:in `app' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!' 
    from /Users/sr027976/.rvm/gems/[email protected]_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/[email protected]_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval' 
    from /Users/sr027976/.rvm/gems/[email protected]_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/[email protected]_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/rack-1.4.4/lib/rack/server.rb:200:in `app' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/rack-1.4.4/lib/rack/server.rb:254:in `start' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>' 
    from /Users/sr027976/.rvm/gems/[email protected]_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap' 
    from /Users/sr027976/.rvm/gems/[email protected]_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>' 
+0

您確定openssl實際安裝在您的計算機上嗎? – Raindal

+0

是的。 bash-3.2 $ openssl version OpenSSL 0.9.8r 2011年2月8日 – Micheal

+1

可能會安裝ssl,但ruby找不到它。你是如何安裝ruby的? RVM?你指定了--with-open-ssl-dir嗎?你有沒有試過'rvm pkg install ssl'? –

回答

0

這些是我執行的步驟,它爲我工作。 rvm get head

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 
0

假設你已經opensll安裝是否正確 - 你應該重新安裝檢查,聽起來像一個RVM相關的問題。出現最壞的情況我會嘗試重新安裝RVM(這是一種很麻煩的)

0

創建使用RVM

一個寶石
rvm gemset create gemset_name 

然後運行

bundle install 

這是寶石的實際問題依賴。