close
1.
env 環境設定 production 1.rake assets:precompile (產生錯誤必須先看看rake版本 gem list rake 之後先在public 資料夾下執行 rake assets:precompile
2. /config/environments/production.rb 修改 config.serve_static_assets = true (原本是false) #R 4.0
/config/environments/production.rb修改config.serve_static_files=true(原本是false) #R 4.2
#####
錯誤 index.html and rails.icon no such .....
####
3.rake db:create RAILS_ENV=production
4.rake db:migrate RAILS_ENV=production
5.rails s -e production 備註;如果有程式本身有問題會跑不起來!asstes必須先打包因為開發模式跟上線模式在config是設定不同的
rake secret 需要產生並且加在 .yml 的production裡面
##注意空白,數量似乎是要剛好
參考資源
http://gogojimmy.net/2012/07/03/understand-assets-pipline/
http://ihower.tw/rails3/assets-and-ajax.html
全站熱搜