Rails 404 error for Stylesheet or JavaScript files

后端 未结 2 1520
感情败类
感情败类 2021-01-15 04:16

Rails can\'t load (404 error) CSS & JS files on production but has no problem loading them in development.

I\'m using Capistrano for deployment and running Rails

2条回答
  •  广开言路
    2021-01-15 04:56

    I fixed this problem by running this command:

    RAILS_ENV=production rake assets:precompile
    

    Reference: http://guides.rubyonrails.org/asset_pipeline.html

    My environment is Nginx + Unicorn + Rails4

提交回复
热议问题