. . .

500 error with rails application running in production via apache2 & passenger

Published: January 7, 2015

On This Page

    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

    touch tmp/restart.txt

    after making changes to your application.

     

    Don't forget to share this post

      Let's Build Digital Excellence Together


      • Cost Efficient Solutions.
      • Minimal Timelines.
      • Effective Communication.
      • High Quality Standards.
      • Lifetime Support.
      • Transparent Execution.
      • 24/7 Availability.
      • Scalable Teams.

      Join Our 200+ Happy Clients Across Globe


      Free Consultation.

        Do you need tech help of your startup/business? Experts from our team will get in touch with you.

        Please do not post jobs/internships inquiries here.