3

I am trying to deploy a rails application on Bluehost using passenger and I have been failing all the time. I installed the passenger gem using:

gem install passenger

And also ran:

passenger-install-apache2-module

And ran all my db migrations and also did a asset precompile

The problem is, I am trying to host it on a sub-domain, so I did the following steps:

  1. Created a sub-domain.
  2. Created a sym link from rails app pointing to the sub-domain.
  3. Added the following lines to my .htaccess:

PassengerEnabled On

PassengerAppRoot /home/username/rails_apps/my_app

And when I navigate to my domain in the browser it gives me:

Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@sub.domain.com

Where am I going wrong?

Thanks in advance :)

Community
  • 1
  • 1
swaroopsm
  • 1,389
  • 4
  • 18
  • 34
  • I think you don't need to install `passenger`. Have you read their documentation? https://my.bluehost.com/cgi/help/rails – Yevgeniy Anfilofyev May 21 '13 at 06:40
  • I have installed passenger. And I have also tried their documentation, but did not work for me. – swaroopsm May 21 '13 at 09:57
  • what do the apache error and access logs say? – Bornfree May 23 '13 at 09:00
  • They don't say anything. I viewed my error logs from the cpanel provided by bluehost. Is there any other way of seeing my apache error logs? – swaroopsm May 24 '13 at 08:41
  • I am also facing the same error. I also installed passenger. Now its giving me "database configuration does not specify adapter" but when I start server using rails s it works.. kinda weird error.. – mandar.gokhale Jul 01 '13 at 22:26

3 Answers3

1

Hey have you checked user & group in your httpd conf file? make sure that if you have user/group www-data in httpd conf then your project directories should have same owner & group.

mandar.gokhale
  • 1,876
  • 1
  • 18
  • 37
  • I am planning to buy a VPS from linode very soon. I am not quite happy with a shared server, as it does not offer much. Thanks for the reply. Cheers :) – swaroopsm Jul 02 '13 at 04:42
1

I also tried doing the same thing, but was unsuccessful, but when I dig a bit deep I figured out following:

  • The apache server in Bluehost uses passenger in different path. Hence our installation would not affect it.

  • Passenger3.x of Bluehost is using ruby 1.8 as default one, hence the ruby version cannot be changed.

vikas
  • 668
  • 6
  • 10
1

Check Bluehost on what needs to be in the .htaccess file. Mine looks like this:

<IfModule mod_passenger.c>
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
#Set this to whatever environment you'll be running in
RailsEnv production
RackBaseURI /home/rails_apps/my_app
SetEnv GEM_HOME /home/<my_bluehost_username>/ruby/gems
</IfModule>

You should use this command to find your ruby gems location:

gem env
JanuskaE
  • 1,284
  • 2
  • 8
  • 12