View Full Version : What is the status of Ruby on Rails?
ben_brown30
03-27-2006, 02:41 AM
I have recently joined Bluehost and have started to try out the Ruby on Rails support.
I have read many tickets on the subject telling me that we need to install xyz gem etc etc and many which say that the gems have been installed.
I have SSH access to my account and can see that the fcgi gem and mysql gem are installed along with rails and a few others.
I am trying out the 'cookbook' tutorial from http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html and I have simply uploaded the completed application to my account, added a sym link to the public folder as a subdomain http://ruby.ben-brown.co.uk and I see the welcome to Ruby page.
I have changed the database settings and have uploaded some data from the application but when I navigate to ruby.ben-brown.co.uk/recipes/new/ I get a 500 error, which is reflected in my logs as
Premature end of script headers: /home/aviewfr1/public_html/ruby/dispatch.cgi
This is accessing RoR through apache as CGI as I did not want to complicate things by trying fcgi until I could get CGI running first!
Firstly: What is the status with RoR? Do we need to do anything at all to get it running on Bluehost servers?
Secondly: Does anyone have know what settings to use for the dispatch files that will work correctly on Bluehost?
Did you try calling BH Support regarding this issue? If so, what did they have to say?
ben_brown30
03-28-2006, 06:08 AM
Not called them yet, but I'm going to put in a ticket - will fill you in on the details as and when they come!
timberford
03-29-2006, 04:22 AM
i have a post on my website that explains what i went through to get ruby on rails going on bluehost...
http://www.paulsturgess.co.uk/articles/show/8
maybe it will help you out.
ben_brown30
03-30-2006, 12:17 AM
Thanks Paul - site looks good. I seem to have done most things the same as yourself.
Is there any chance you could post your app/public/dispatch.* files.
Also do you use fcgi or just cgi?
Thanks in advance
ben_brown30
03-30-2006, 09:35 AM
Here is the response I got from Bluehost:
While I know Ruby On Rails is fully configured on all of our machines. There's nothing that needs to be done to apache or their cpanel config or anything, nor should they have to compile anything. Ruby On Rails is 100% set up right now. You have some pretty specific questions that I have escalated. You should receive a response to them within the next few hours.
Followed later by the email from the level 3 support team:
I just wanted to confirm that you followed our how too;
<http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=232>
Running Ruby on Rails on BlueHost works mostly like the Rails documentation says. In order to run the 'rails' command to generate your application, you will need to have shell access enabled.
You should read the ruby on rails documentation to learn how to set it up:
http://www.rubyonrails.org/
If you would like to use fastcgi, you will have to change the public/.htaccess file to say dispatch.fcgi instead of dispatch.cgi
You can not use the script/server method of testing unless you have a dedicated IP. If you have a dedicated ip, you must do:
script/server -b YOUR_IP_ADDRESS
Set up a test rails application using the following commands:
rails railstest
ln -s /home/username/railstest/public ~/public_html/app
Then, edit railstest/public/.htaccess to look at dispatch.fcgi instead of dispatch.cgi.
After this point, just follow whichever Ruby On Rails tutorial you like best.
I can confirm that I am now able to create a RoR application.
The problem I was having is that in following the OnLAMP tutorial I downloaded the source code and attempted to use this on the Bluehost servers. What the tutorial does not seem to make clear is that when you create a new application using 'rails appname' this will create despatch* files that are set up for the system the application was created on.
I can confirm that to get the RoR application working required no configuration apart from changing cgi to fcgi in the .htaccess file in app/public/
Hope that clears it up for anyone else who is confused!
cantinflas83
05-16-2006, 02:30 PM
The problem I was having is that in following the OnLAMP tutorial I downloaded the source code and attempted to use this on the Bluehost servers. What the tutorial does not seem to make clear is that when you create a new application using 'rails appname' this will create despatch* files that are set up for the system the application was created on.
I can confirm that to get the RoR application working required no configuration apart from changing cgi to fcgi in the .htaccess file in app/public/
Hope that clears it up for anyone else who is confused!
It looks like I'm having the same problem you had. What files need to be changed to correct the despatch* files? What changes need to be made to those files? Thanks!
ben_brown30
05-17-2006, 03:02 AM
If you create a new application using the command 'rails appname' on the Bluehost servers, this will create the correct despatch files to use with the project. You can then copy these files over to the tutorial and they will work correctly.
The changes to the files are changes to the paths to Ruby etc, rather than trying to go through the hassle of working out what's change, create the new project and copy over the files.
rando
05-17-2006, 08:44 AM
I'm working on a new tutorial specific to bluehost.
The basis of my tutorial will be the official tutorial that begins here: http://wiki.rubyonrails.org/rails/pages/Tutorial
One thing you should understand is that the entire page I just linked above relates to setting up rails on your server. As rails is already set up on bluehost, you don't have to follow it. At the bottom of that page, however, is where the "development" portion of the tutorial begins.
It links you to six tutorial steps, (the first one at http://wiki.rubyonrails.org/rails/pages/TutorialStepOne), which teach you how to develop a ruby on rails application.
The version of the tutorial that I'm writing will mostly be links to the different tutorial steps, except that it will include information on exactly what's different about using rails on bluehost for those who are unable to figure that out on their own.
Please be patient for my lack of speed in writing this, I've been writing it at home on my own time as I've been really busy with a few huge projects at work that I can't pull myself away from.
cantinflas83
05-17-2006, 11:44 AM
It worked! Thank you!
Thanks for all the help!
Sporky023
08-05-2006, 06:24 AM
The changes to the files are changes to the paths to Ruby etc, rather than trying to go through the hassle of working out what's change, create the new project and copy over the files.
I'm still not clear on which files I would need to copy over. I'm really hoping to be able to work on my web app on my own computer and then deploy them to Bluehost, but my understanding of rails is currently a bit shallow.
I'm doing a bit of line-by-line comparison between an app created on bluehost and on my own computer; I'll post some results if I find what changes things. In the meantime, ben_brown30, could you post precisely which files you would copy over from the bluehost-generated app to the tutorial app?
Thanks
- L
ben_brown30
08-07-2006, 02:54 AM
Okay, here's how I see it...
The files which are PLATFORM DEPENDENT i.e. will not be copied from Bluehost to your localhost and vice versa are:
public/dispatch.cgi
public/dispatch.fcgi
public/dispatch.rb
The rest of the files are PLATFORM INDEPENDENT (as far as I can tell) and so can happily be copied across from Bluehost to localhost.
You will of course need to change the database settings in config/database.yml for Bluehost and localhost unless you name your databases identically on your local machine.
Give that a try and see how you go.
Ben
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.