LoginSignup
0
2

More than 5 years have passed since last update.

capistranoでcssが読み込まれない

Posted at

capistranoで苦しみがちなので、解決するためのメモとして。

capistranoで自動デプロイしてもエラー

環境
Rails5
AWS EC2
unicorn
nginx

最初はアプリにアクセスしても、HTMLのコードすら、読み込まれてなかった。
いろいろいじってみたが、最終的には、サーバー側のアプリを削除して、gitからcloneしなおしたら、本番環境でHTMLのコードは読み込まれるようになった。(バリバリ稼働してるアプリだったらアウトな手段な気がする。。)

しかし、CSSやjsなどのassetsは依然読み込まれず。
unicornで動いているプロセスをkillし、/var/www/app_nameに移動し、
$ RAILS_ENV=production bundle exec rake assets:precompile assets:clean
で、手動でassetsをぶち込んで、
ローカルで、
$ bundle exec cap production deploy
したら、assetsが読み込めるようになった。

0
2
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
2