2013-08-28 44 views
2

我是一個rails noob,我在Heroku上有一個rails生產應用程序。 爲了擁有更加審慎的部署前評估我設置成使用平常 升級版本:在Heroku上的rails應用程序升級版本中丟失.scss

$ heroku create --remote staging 
$ git push staging master 
$ heroku run rake db:migrate --remote staging 
$ heroku open --remote staging 

,當我啓動升級程序,它看起來除了所有的CSS/SCSS沒有運行罰款。

我忽略了什麼?

這裏是我的environment.rb文件中:

# Load the rails application 
require File.expand_path('../application', __FILE__) 

# Initialize the rails application 
Usrochr::Application.initialize! 

,這裏是我的production.rb文件[我staging.rb相同]:

Usrochr::Application.configure do 

config.cache_classes = true 

config.consider_all_requests_local  = false 
config.action_controller.perform_caching = true 

config.serve_static_assets = false 
config.assets.compress = true 
config.assets.compile = false 

config.assets.digest = true 
config.i18n.fallbacks = true 
config.active_support.deprecation = :notify 

end 
+0

工作,你可以請把你的'production.rb'和'環境。 rb'文件 –

+0

這裏是我的environment.rb文件: – user2284821

+0

where?....順便檢查你的production.rb ............'config.serve_static_assets = true'也默認資產:預編譯不會處理/ vendor/assets中的css/js文件。在production.rb中,你可以使用config.assets.precompile獲得由資源預處理的另外的css/js文件precompile'config.assets.precompile + =%w [bootstrap/* .css bootstrap/* .js]'然後'rake assets:precompile'會處理它們,他們將在heroku上工作。 –

回答

1

檢查production.rb的.. .......... config.serve_static_assets = true默認情況下,assets:precompile將不會處理/vendor/assets中的css/js文件。在production.rb你可以使用config.assets.precompile來獲得額外的css/j s個文件由資產預編譯config.assets.precompile += %w[ bootstrap/*.css bootstrap/*.js ]處理然後耙資產:預編譯會處理他們,他們會在Heroku

+0

我想知道爲什麼css資產在生產中很好,但只有當我設置暫存版本時出現問題? – user2284821

+0

它不應該是https://devcenter.heroku.com/articles/multiple-environments我認爲你按照此..謝謝 –