加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

ruby-on-rails – 在Rails中获取“从应用程序收到的不完整响应

发布时间:2020-12-13 21:32:20 所属栏目:Nginx 来源:网络整理
导读:有人可以帮忙吗?我的堆栈是ubuntu-server 14.04,其中包含nginx / passenger和ruby 2.2.2.我无法让我的项目在生产中工作.一切都在开发中运行良好. secrets.yml production: secret_key_base: 服务器 server { listen 80; server_name logvs.local; passenger

有人可以帮忙吗?我的堆栈是ubuntu-server 14.04,其中包含nginx / passenger和ruby 2.2.2.我无法让我的项目在生产中工作.一切都在开发中运行良好.

secrets.yml

production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
  secret_token: <%= ENV["SECRET_KEY_BASE"] %>

服务器

server { 
    listen 80; 
    server_name logvs.local; 
    passenger_enabled on; 
    passenger_app_env development;
    root /var/www/logvs/public; 
}

error.log中

App 2532 stderr: [ 2015-06-07 22:56:01.4724 2610/0x000000014d6b00(Worker 1) utils.rb:85 ]: *** Exception RuntimeError in Rack application object (Missing `secret_token` and `secret_key_base` for 'production' environment,set these values in `config/secrets.yml`) (process 2610,thread 0x000000014d6b00(Worker 1)):
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/application.rb:534:in `validate_secret_key_config!'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/application.rb:246:in `env_config'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/engine.rb:514:in `call'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/application.rb:164:in `call'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/passenger-5.0.9/lib/phusion_passenger/rack/thread_handler_extension.rb:94:in `process_request'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/passenger-5.0.9/lib/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/passenger-5.0.9/lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/passenger-5.0.9/lib/phusion_passenger/request_handler.rb:414:in `block (3 levels) in start_threads'
App 2532 stderr:    from /home/username/.rvm/gems/ruby-2.2.2/gems/passenger-5.0.9/lib/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'
[ 2015-06-07 22:56:01.4731 2508/7f6775575700 age/Hel/Req/Utils.cpp:95 ]: [Client 1-1] Sending 502 response: application did not send a complete response

编辑:我忘了说我正在使用设计进行身份验证

最佳答案
我有类似的问题.我最终在生产服务器的.profile(或类似的)文件中手动输入生产中的env变量.

app error: Missing `secret_token` and `secret_key_base` for 'production' environment

我在那里找到了很好的答案How to solve error “Missing `secret_key_base` for ‘production’ environment” (Rails 4.1)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读