Rails 3.1rc4 and 404 not found when accessing assets
I'm trying to port my rails 3.0.7 project to rails 3.1
I have Phusion开发者_开发知识库 Passenger running on nginx + rvm.
There is config.assets.enabled = true in my application.rb file.
I created empty rails 3.1 project and copied my app directory, routes.rb and application.rb files over it. I moved everything from public to app/assets (app/assets/stylesheets etc). When I'm trying to access assets (application.css/application.js), I'm getting 404 not found error, but I can see them in app/assets/stylesheets/application.css and app/assets/javascripts/application.js.
Help me please.
UPD: Thanks to Devin M for the idea, I removed css,js,gif,png and jpg extensions from nginx.conf ("serve static files directly") and everything started to work.
I came to this question with a similar problem (everything was giving a 404) I found that Rails 3.1.0.rc4 has a problem with gem 'sprockets'
In your Gemfile set:
gem 'sprockets', '= 2.0.0.beta.10'
Note: you may have to manually override your Gemfile.lock before you bundle install
Usually this is a problem with the nginx config not set up to serve things correctly. Double check your config files.
精彩评论