简体   繁体   中英

Ruby on Rails Assets not found

Ubuntu Ruby on Rails on 14.04 (Nginx + Unicorn) on digitalocean. My rails application was working fine until now. But, suddenly I am facing this error and none of my stylesheets/javascript files are loading.

I did rake assets:precompile. But, it doesn't work. I don't want to set

config.assets.compile = true

This will take a toll on my website. I have been going through a lot of solutions available online but they all suggest to set the above code to 'true'. I can't understand what has gone wrong!

I, [2015-02-12T14:31:37.688066 #19201]  INFO -- : Started GET "/stylesheets/application.css" for 1.22.191.212 at 2015-02-12 14:31:37 +0000
I, [2015-02-12T14:31:37.691759 #19201]  INFO -- : Processing by VendorsController#index as CSS
I, [2015-02-12T14:31:37.695637 #19201]  INFO -- : Completed 500 Internal Server Error in 4ms

The error that you are getting is 500, not 404. So, it might be other problem that being able to locate the required files. Try the path to the compiled resources manually and see if they are loading.

Just to confirm, the application was already properly running in Production environment, right?

You might want to try serving the files as static content from public folder, though that will be a slight overhead on performance.

If you have already got the solution, share here! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM