user782220
user782220

Reputation: 11207

What does rake assets:precompile do without RAILS_ENV=production?

If I run the following commands and then visit a page it gives an error about routing failure on an asset.

rake assets:precompile
rails s -e production

However if I do the same after the following commands where I've added RAILS_ENV=production everything works.

rake assets:precompile RAILS_ENV=production
rails s -e production

What is rake assets:precompile doing when I omit RAILS_ENV=production that explains why it is not working properly?

Upvotes: 1

Views: 285

Answers (1)

Doon
Doon

Reputation: 20232

It is precompiling the assets in your default environment, which is more than likely developement

Upvotes: 1

Related Questions