It is running Rails 3.0.0 or Rails 3.0.5 (using Ruby 1.9.2)
When in development mode
rails server
then http://localhost:3000 works all fine, and http://localhost:3000/foos will load up a stylesheet.css
but when it is
rails server -e production
then now all of a sudden, http://localhost:3000 gives:
No route matches "/"
and http://localhost:3000/foos can run, but the stylesheet.css
is not loaded and opening it in the browser shows:
No route matches "/stylesheets/scaffold.css"
Is special route needed for production vs development? (or is it for some other reason?)
You need to set
config.serve_static_assets = true
in config/environments/production.rb
. It's likely commented out in there already.
By default Rails does not serve static files by itself in production, since full-on web servers like Nginx or Apache, will serve them automatically anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With