Cap deploy 部署,完成之后发现出现:
!! Unexpected error while processing request: You must set config.secret_key_base in your app's config.
deploy 是仿照 ruby-china 的代码, 发现里面有
task :link_shared_files, :roles => :web do
run "ln -sf #{shared_path}/assets #{deploy_to}/current/public/assets"
run "ln -sf #{deploy_to}/shared/config/*.yml #{deploy_to}/current/config/"
run "ln -sf #{deploy_to}/shared/config/initializers/secret_token.rb #{deploy_to}/current/config/initializers"
这里有个疑问,/shared/config/initializers/secret_token.rb 这个文件(包括路径本身是不存在的),是不是需要部署是特意手动在 shared 里建立这个路径,生成文件 还是 deploy 文件里少了某些步骤?
另外, :compile_assets 被注释后,也是需要手动在 deploy 后的 appname/current/ 里进行手动 RAILS_ENV=production bundle exec rake assets:precompile 吗?
after "deploy:finalize_update","deploy:symlink", :init_shared_path, :link_shared_files, :mongoid_migrate_database #, :compile_assets
请教 @huacnlee ,非常谢谢!