2016-08-26 9 views
1

これで、Rails 5 herokuレビューアプリでは、RAILS_ENVがconfig varsセクションの "production"に設定されています。私は、「ステージング」に値を変更し、Herokuのレビューアプリにレールコンソールを実行しようとすると、それはのエラー出力でクラッシュ:英雄レビューアプリでRAILS_ENVをステージングに設定するにはどうすればよいですか?

config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly: 

* development - set it to false 
    * test - set it to false (unless you use a tool that preloads your test environment) 
    * production - set it to true 

    /app/vendor/bundle/ruby/2.3.0/gems/devise-4.1.1/lib/devise/rails/routes.rb:498:in `raise_no_secret_key': Devise.secret_key was not set. Please add the following to your Devise initializer: (RuntimeError) 

     config.secret_key = 'xxx' 

    Please ensure you restarted your application after installing Devise or setting the key. 
     from /app/vendor/bundle/ruby/2.3.0/gems/devise-4.1.1/lib/devise/rails/routes.rb:226:in `devise_for' 
     from /app/config/routes.rb:6:in `block in <top (required)>' 
     from /app/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec' 
     from /app/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `eval_block' 
     from /app/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:371:in `draw' 
     from /app/config/routes.rb:1:in `<top (required)>' 

は私が持っている意味「ステージング」にRAILS_ENVを設定していRailsはそこから環境設定を推測するので、config/staging.rbファイルを作成しますか?

答えて

1

結局のところ、3つの事が必要とされていた:

私はHerokuのの設定は、HerokuのレビューアプリのセクションをvarsのでステージングRAILS_ENV設定する必要がありました。 config/environments/development.rbのコピーであるconfig/environments/staging.rbファイルを作成しました。私はまた、秘密バンドルのexec熊手を使用して秘密鍵を生成し、コピーして、あなたがリンク後参照してくださいすることができます

staging: 
    secret_key_base: 12345xxy 
関連する問題