1

I'm developing a rails 4 application with ruby 2.0.0. Using the default application (just right after rails new ... ) switching between rails s (or rails s -e development) and rails s -e production the development version works fine and production version alerts an error:

No route matches [GET] "/"
Rails.root: /var/lib/stickshift/5239e9de500446eae7000028/app-root/data/584830

I already changed the config/production.rb:

  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = true
  config.serve_static_assets = true
  config.assets.compile = true
  config.assets.digest = true

This didn't work.

Then I just copied the config/development.rb to config/production.rb and started rails s -e production and so with equal config the development version works fine, but production still returns the same error.

What could be so different in production and development environments?

Update:

I did all steps from this tutorial and still - no static files are available to serve [https://devcenter.heroku.com/articles/getting-started-with-rails4]

static
  • 8,126
  • 15
  • 63
  • 89

1 Answers1

0

I think the only thing that makes that difference is that rails doesn't add a default "Hello world" root in production. And that's not in the configs. That's why it gives an error, saying that you don't have a root route.

Almaron
  • 4,127
  • 6
  • 26
  • 48
  • strange is that in development environment all the static files are served and in production environment they are not served – static Sep 19 '13 at 19:25
  • hm..never had that problem. If I set the confir properly, static assets show as needed. – Almaron Sep 19 '13 at 19:30
  • Tried just now - everything's fine if you set `config.serve_static_assets = true` and `config.assets.compile = true` (or run `RAILS_ENV=production rake assets:precompile`). – Almaron Sep 19 '13 at 19:36