2014-02-18 34 views
0

我在我的rails應用程序中出現下面的錯誤。爲什麼nitrousio配置密鑰基地給出了錯誤的Rails應用程序的配置?

我on Rails應用程序運行Ruby,我點擊預覽,我得到如下:

Internal Server Error You must set config.secret key base in your app's 
config 

DEPRECATION WARNING: You didn't set config.secret_key_base. Read the upgrade documentation to learn more about this new config option. (called from service at /home/action/.rvm/rubies/ruby-2.0.0 
-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138)                                     
[2014-02-18 21:48:14] ERROR RuntimeError: You must set config.secret_key_base in your app's config.                        
     /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/application.rb:145:in `env_config'                     
     /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/engine.rb:507:in `call'                        
     /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/application.rb:97:in `call'                       
     /home/action/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'                          
     /home/action/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'                        
     /home/action/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'                       
     /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'                        
     /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'                         
     /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread' 

有人可以幫我這一點。

感謝

+0

是你的secret_key_base集?你會在'config/initializers/secret_token.rb'中找到它,它會在一行代碼中定義,比如'AppName :: Application.config.secret_key_base =「asdfJSSKDJFH78&KJHFDSDSFSDklkjfdLKJ」' – toolz

回答

2

你應該,我想,在你所謂的secret_token.rbconfig/initializers目錄中的文件。在該文件中,您會看到類似的內容:

# Be sure to restart your server when you modify this file. 

# Your secret key is used for verifying the integrity of signed cookies. 
# If you change this key, all old signed cookies will become invalid! 

# Make sure the secret is at least 30 characters and all random, 
# no regular words or you'll be exposed to dictionary attacks. 
# You can use `rake secret` to generate a secure secret key. 

# Make sure your secret_key_base is kept private 
# if you're sharing your code publicly. 
MyApp::Application.config.secret_key_base = 'de6156670dfadf0101011000112310980198236544e55623a143c9ae5254842b2c66fcc59849' 

如果不存在,請嘗試創建一個。

+0

我檢查是否找到該文件?我還可以修復這個錯誤 – user3306918

+0

這是我找到的 – user3306918

+0

Catarse :: Application.config.secret_token = find_secure_token Catarse :: Application.config.secret_key_base = find_secure_key_base – user3306918

相關問題