0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

productionモードでサーバーを立ち上げるとcssが反映されない。

Posted at

##producition用のデータベース作成

rails db:create RAILS_ENV=production

##アセットのプリコンパイルを行います

rails assets:precompile RAILS_ENV=production

##サーバー起動

rails s -e production -b 0.0.0.0

...cssが反映されない。。

##解決策
config/enviroments/production.rbの

config.assets.compile = false
config.assets.compile = true

に変更したらうまくいきました。
アセットファイルがないときにファイルを探して自動コンパイルしてくれる設定のようです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?