簡體   English   中英

Rails服務器將無法運行

[英]Rails server won't run

我過去兩天一直在嘗試設置Ruby on Rails。 我讓他們在一個階段跑,但打破了它。 我已經通過RVM重新安裝了Ruby和Rails,我試圖繼續學習我一直在研究的教程。 我遇到的問題是,當我在Rails app目錄中運行命令'rails s'時,我收到以下錯誤消息:

    Exiting
/home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require': no such file to load -- openssl (LoadError)
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/session/cookie.rb:1:in `<top (required)>'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
    from /home/hugo/.rvm/gemsin my terminal /ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/configuration.rb:131:in `const_get'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/configuration.rb:131:in `session_store'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:172:in `block in default_middleware_stack'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:146:in `tap'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:146:in `default_middleware_stack'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/engine.rb:446:in `app'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/hugo/rails_projects/web_app/config/environment.rb:5:in `<top (required)>'
    from /home/hugo/rails_projects/web_app/config.ru:4:in `require'
    from /home/hugo/rails_projects/web_app/config.ru:4:in `block in <main>'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `instance_eval'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `initialize'
    from /home/hugo/rails_projects/web_app/config.ru:1:in `new'
    from /home/hugo/rails_projects/web_app/config.ru:1:in `<main>'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `eval'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `parse_file'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:200:in `app'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:46:in `app'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:301:in `wrapped_app'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:252:in `start'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in <top (required)>'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap'
    from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

有人可以向我解釋這個錯誤嗎? 我變得很累。 提前致謝。

你編譯ruby沒有openssl依賴。

rvm requirements

(或rvm notes如果您使用的是沒有rvm requirements的舊版本的rvm)並查看您需要在系統中安裝的內容(例如,如果您正在運行ubuntu,這些是apt-get命令),然后重新編譯你的ruby安裝

rvm remove 1.9.2
rvm install 1.9.2

第一行有以下錯誤:

`require': no such file to load -- openssl (LoadError)

RVM需要知道如何訪問openssl庫。

有關使用RVM設置openssl的更多信息,請參見http://beginrescueend.com/packages/openssl/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM