I sometimes face 500 Internal Server Error when running Ruby on Rails application on Apache Passenger but the same application is working fine with webrick server. One of the following reasons are responsible for the issue.
1. Permission Issues
Check permission of the files and directories of your project. It should be writeable by the user running webserver.
2. Check your database settings
Check your database settings in config/database.yml file. Make sure that the database specified in production settings exists and username/password is correct.
3. Secret Key Base:
Make sure you have provided a value for secret_key_base in your config/secrets.yml file. The most easier way to do this is to manually set it in secrets.yml file. In the ternimal of your server, execute
RAILS_ENV=production rake secret
Copy the generated string and paste it in your secret.yml file inplace of <%= ENV[“SECRET_KEY_BASE”] %>
Dont forget to restart by running
after making changes to your application.