我讀http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html ,看到那裏config/secrets.yml
使用config/secrets.yml 4.0.2版本
我搬到我的secret_base_keys該文件,並刪除secret_token.rb
文件的伎倆。
但服務器無法啓動。
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/bismailov/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/httpserver.rb:138)
[2014-01-15 16:15:51] ERROR RuntimeError: You must set config.secret_key_base in your app's config.
我相信那是因爲我還沒有使用Rails 4.1。
有什麼辦法可以在Rails 4.0版本中實現這個新功能(secrets.yml)嗎?也許某種寶石...
非常感謝!
運行耙祕密,然後啓動服務器做到了從Rails的4.1借用一些代碼在上面的鏈接中提到。 –
我嘗試'耙祕密'沒有。但'rake secret'起作用,我生成了兩個用於secrets.yml的祕密標記 –