This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here

Skip to main content

Just Host Web Hosting Help

Ruby on Rails application generates a 500 - Premature end of script error

Problem:

When I attempt to execute my Ruby on Rails application I receive "500- Premature end of script."

Solution:

This error generally has two potential causes:

  • The file permissions are not set to allow the dispatch.cgi to execute properly.

    Chmod the dispatch.cgi to 0755.

  • The path to Ruby is is incorrect in the dispatch.cgi file.

    The first line of the file is called the hashbang-- it sets the location of the interpreter (in this case ruby).

    Change the hashbang to the correct path to Ruby (/usr/bin/ruby).
    The first line of the dispatch.cgi file should look like this:
    #!/usr/bin/ruby

Knowledgebase Article 88,697 views bookmark tags: premature rails ruby script


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

My Ruby on Rails installation keeps displaying a '404 Not Found' error.
Knowledgebase Article 166,097 views tags: file missing public rails ruby

What Ruby on Rails version and Gems are installed?
Knowledgebase Article 96,690 views tags: gem gems rails ruby

How do I setup Ruby on Rails?
Knowledgebase Article 333,167 views tags: rails ruby

Related Help Content

How to install Redmine a Ruby on Rails application
Knowledgebase Article 66,292 views tags: redmine ruby

How do I install my own Ruby Gems?
Knowledgebase Article 120,142 views tags: gem install ruby

Rails Troubleshooting!
Knowledgebase Article 47,291 views tags: rails

What is the path to Ruby?
Knowledgebase Article 109,251 views tags: path ruby

Does your company have any limit about CGI script use?
Knowledgebase Article 166,219 views tags: cgi script

Website shows a server 500 error, what can I do to fix it?
Knowledgebase Article 505,710 views tags: error

How do I use .html files to run SSI (Server Side Includes)?
Knowledgebase Article 192,761 views tags: apache execute file handlers include script ssi

How to setup your Just Host-hosted email address with an email application.
Knowledgebase Article 692,020 views tags: application client email mail outlook webmail

** Google ad credits are only available to customers in the United States, Canada, and the United Kingdom at this time.

¹ VAT (Value Added Tax) is not included in our advertised price and will be charged separately and itemized on invoices and billing information. Standard VAT rates based on EU Member State regulations may apply. Learn more.