Nilay Singh
Nilay Singh

Reputation: 2331

Rails 5 Debug in Production Mode

I am trying to find a way to check logs or debug in production I am using passenger and apache and ubuntu as server. Every time I create any scaffold and upload it to server I get error : enter image description here

I have used

 bundle exec rake  assets:precompile  RAILS_ENV=production

But getting no success but when I am running application using :

 rails s -e production

I can access my controllers and views over port 3000. What is wrong with this why assets:precompile is not working properly I am adding JS files manually not using coffee script. And my javascripts files are not complied.

My question is how can I set anything in production to see a debug like in development mode like this: enter image description here

Can I do this in production I am using rails 5

Upvotes: 0

Views: 1513

Answers (1)

Maru
Maru

Reputation: 600

The production error you have shown above was a 404 error. it means that the route doesn't exist or there are no controllers methods for that route or is a model not found error.

As for adding debuggers in production, can you do it?

Yes you can.

But should you do it?

NO, because it is a BAD practice. If you wish to view and debug errors in production, check your logs for the stacktrace and work with it from there. As long as it is a rails error, it will be in log/production.log.

Upvotes: 1

Related Questions