Rails 3.1 Deploy to Production (with Apache & Passenger) Asset Problems

我们两清 提交于 2019-12-02 18:33:11

That's a simple permission problem. Give the server/daemon the right to create files in [app_path]/tmp recursively.

Assuming your server process runs with the www-data user you do this with:

cd APP_PATH
chmod -R u+w tmp

and if the directory does not belong to the user you have to change the ownership:

chown -R www-data tmp

Try creating public/assets via sudo or try performing rvmsudo rake assets:precompile - essentially, it's not able to create the directory on your server — hence the error.

On Windows 8:

  1. Remove references to stylesheets
  2. Restart production
  3. Go to an affected page using browser
  4. Add stylesheet references back
  5. Restart production
  6. Worked for me!

Your updated solution did not work for me. I am on rails 4.2 and css and js works only when I set config.serve_static_files = true (which is not recommended but it is the only way I can make things work here).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!