0

I have Rails 4.1.6 app on Passanger (Shared host).

Quite a while I worked in development, but now I switched to production.

In environment.rb:

ENV['RAILS_ENV'] = 'production' 

then touch tmp/restart.txt to restart server.

When accessing my app I am receiving Internal Server Error. It is ok. I expected that, so I went to production.log to see what caused error, but it was blank.

Before I switched to production, development.log file showed all logs without problem.

What I tried:

1) Deleted production.log and restarted server. After folder reload production.log was created again. Permisions: 0664 the same as development.log

2) Added lines and restarted server :

      config.log_level = :debug
      RAILS_DEFAULT_LOGGER = Logger.new('log/production.log')

3) Double checked if current environment is production.

4) Manually wrote in production.log using console command:

Rails.logger.error('TEST ERROR')

After this command I saw this error message in production.log file.

Thanks in advance for any help.

Edgars
  • 913
  • 1
  • 19
  • 53

1 Answers1

0

Finally, I solved my problem.

Bassically, there wasn't any problem with production.log , problem was that my Rails 4 app didn't really start. I received Apache error:

Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`

So I solved above error with help of this answer

And now Rails 4 app starts and production.log updates without problem.

Community
  • 1
  • 1
Edgars
  • 913
  • 1
  • 19
  • 53