I’m stuck with my deployment on a Premium GoDaddy Web Hosting
account. I have read every hint I can find in this group and through
Googling. That’s gotten me to the point that I can see the index.html
page in the public directory. For both a real app and a simple test
app. When I try to run a test app, I get a 404 page. When I click on
“About your application’s environment,” I get the rails standard page
not found.
GoDaddy support tells me that they checked my site with a cookbook
app, and it works. They refuse to share the code, though.
I think it’s something basic, though. I can’t even get the simple
apps to show up on the list of rails apps in the GoDaddy CGI_admin
console to create a symlink.
I could really, really use a copy of a simple app that’s working on
GoDaddy (and the .htaccess files, just to to be sure.)
I’m desperate. I’ve already paid for several years of the service. I
even paid a company to deploy my app on GoDaddy. They took my money
and didn’t do it. I’m embarrassed to say how much of my money they
took…
For the longest time I had an example rails app up and running without
problem on goDaddy (unless of course you consider 10 second spin up
time a problem). Anyway, just recently I tried setting up a rails 2.0
app so that I could update my blog and was unable to get it to do
anything. I’m pretty sure some of the problems include the
‘require_gem’ to ‘gem’, etc updates.
So, in a roundabout way, what I’m trying to say is that unless this is
a Rails 1.2 app, I’m 99% sure you’re not going to get it running on
goDaddy.
One new bit of new information. It was a bad .htaccess file at the
top level directory of the whole web site that was making the
cgi_admin console not see any of my app directories. I think I had
copied one of the ones that GoDaddy provided. So, word to the wise:
don’t trust the GoDaddy auto-created .htaccess files.
The news about 2.0 apps is scary. I upgraded when I bought a new
laptop a few months ago…
It seems clear to me that the GoDaddy support folks I talked to knew
exactly what my problem was, and were trying to provide hints, but
could not tell me directly. It’s been some weird conversations along
the way, including the one about “yes, we successfully ran a test app
on your site, but we cannot give you the working sample…”
Looking at the production logs and the CGI Admin error log (thanks for
the reminder that I should look again!), I figured out that I was
missing the public folder’s subdirectories. But, still stuck. CGI
Admin error log now says:
[Sun Jul 6 21:23:06 2008] [error] [client 67.164.130.54] File does
not exist: /var/chroot/home/content/l/i/s/lisaice/html/cookbook/
recipes/show
[Sun Jul 6 21:23:14 2008] [error] [client 67.164.130.54] Directory
index forbidden by rule: /var/chroot/home/content/l/i/s/lisaice/html/
cookbook/
[Sun Jul 6 21:23:22 2008] [error] [client 67.164.130.54] File does
not exist: /var/chroot/home/content/l/i/s/lisaice/html/cookbook/
recipes/
[Sun Jul 6 21:23:31 2008] [error] [client 67.164.130.54] File does
not exist: /var/chroot/home/content/l/i/s/lisaice/html/cookbook/
recipes
[Sun Jul 6 21:23:36 2008] [error] [client 67.164.130.54] File does
not exist: /var/chroot/home/content/l/i/s/lisaice/html/cookbook/
recipes/show
And the development log now how a complaint about recognizing the
favicon.ico
Yeah. Even I gave up on goDaddy and joined RailsPlayground.
goDaddy does not look like it is serious about Rails and the biggest
issue as mentioned is that there is no SSH!
I just spent a week and a half trying to get a Rails 2.1 app running on
GoDaddy and got nowhere. I gave up and went to another host. I really
don’t think GoDaddy is serious about their support of Rails. For a start
there’s no SSH access.
Anyway, enough ranting. From the error log you showed, it looks to me
that the symbolic link from the web url base folder to the Rails /public
folder may not be configured. But just how to check that when you don’t
have SSH access, I don’t know. You may want to ask GoDaddy support to
check and/or configure the symlink so that the url maps to the /public
directory.
It can be very frustrating, I know. You may wish to consider “cutting
your losses” and moving to a different host. I achieved in a couple of
hours on another host what I failed to achieve in a week and a half on
GoDaddy.
I too gave up on trying to get my app running through GoDaddy. When I
called for help they basically said that sure they offer Rails but they
had no idea on how to get a rails app up and working - they offered no
support. I then went to A Small Orange and even though I had trouble
getting my up up and running on my own I called and asked for help and
they setup everything for me. I have had no problems with A Small Orange
support or customer service - they get an A+ from me. In short stay away
from GoDaddy if you are a rails developer - you will never get it to
work, I have talked to countless numbers of people who have had no
success in getting their rails apps running with GoDaddy.
Wow. That’s dedication. Just what I was looking for a couple weeks
ago!
It only took me a few hours and a couple false starts to get going on
A2. (Mostly required getting the admins to install gems for me
because their auto-installer wasn’t doing the trick. But, they were
SO much more helpful than GoDaddy. And, having ssh access makes a
huge difference…
I know how very challenging it can be to host a ROR application of
GoDaddy. The good news is that after 10 days of blood, sweat and
tears, I finally got it
to work!!!
First, let me start by saying that I’m somewhat of a newbie to Rails.
However, I’ve been programming in Java and/or C# for the last 10+
years so I’ve been
around the block a couple times when it comes to this stuff. Secondly,
this was undoubtedly one of the most challenging development tasks
I’ve undertaken
this year, so please don’t feel bad if you didn’t get it to work the
first 10 attempts because it took me waaaaay more than that!. Well,
with that said, I’m
sure you’re eager to get to the how-to so let’s do it.
Right now, I’d love to write a few paragraphs on how GoDaddy’s Ruby on
Rails support and documentation is abominal, but that would only be
preaching to the
choir… Instead, let’s make some lemonade
One more thing, please forgive and typing/spelling errors, I’m writing
this in Notepad.
Tip - On Vista and XP, if you uninstall a version of Ruby, restart
your computer before reinstalling another version of Ruby, otherwise
the Environment
Variables won’t get set properly.
Installing Rails
Ok, here is where I was REALLY confused early on, mostly because I
didn’t understand terminology (i.e. what is a RubyGem, what does
freeezing a Gem do). I
was also really confused by GoDaddy’s documentation. In some places,
they claim to support Rails 1.1.2, in others it’s 1.1.6. Anyway, to
correctly install
Rails for version 1.1.6:
Run the Ruby185-22.exe installer.
Open a command prompt and type: gem install rails --version 1.1.6
That’s it. [DO NOT download RubyGems 1.2.0 (or any other version) and
then run “ruby setup.rb”!!! Same goes for any other version of Rails,
don’t do it.]
To ensure you’ve setup everything correctly, let’s check the ROR
component’s versions:
Ok, just to quickly recap, all we’ve done so far is to install ROR,
Subversion and create a very simple Rails app - nothing special.
Everything is working
locally, so now it’s time to prepare for FTPing to GoDaddy. This is
another area where I was REALLY confused initially. So before we go
any further I’m going
to outline and explain what we’re going to do and why.
Freeze the application. When you “freeze” a Rails app, your
application will always use that version of Rails and the associated
Ruby Gems, regardless of
what version is installed on the GoDaddy server. In essence, even
though GoDaddy only supports version 1.1.6, by ‘freezing’ your
application, you literally
bundle your entire local environment into your application. So
theoretically, you can run version 2.x.x if you ‘freeze’ your
application before deploying.
Note, I have not tried this as of yet, but I do have a ‘frozen’
version of Rails 1.2.6 running on GoDaddy. So if 1.2.6 runs, then it’s
very likely 2.x.x will
run as well as long as it’s frozen.
Make a copy of the helloworld application and rename it
hellworld_godaddy.
This is a best practice for me because it allows me to have a working
version of my app running on Vista and a ‘ready to promote’ version
for the Linux
server.
Configure some files in the /public and /config directory for use
on GoDaddy.
EASY as 1-2-3…
Ok, go ahead and stop the WEBrick server by typing Ctrl C
First, let’s Freeze our application to version 1.1.6
C:\Development\Projects\Ruby\helloworld>rake rails:freeze:edge
TAG=rel_1-1-6
[**** Note: this may take 30+ seconds ****]
Second, copy of the helloworld application and rename it
hellworld_godaddy
Finally, we need to edit some files in our hellworld_godaddy
directory.
→ /config/environment.rb
Edit the top section of /config/environment.rb to look like this:
ENV[‘RAILS_ENV’] ||= ‘development’
Specifies gem version of Rails to use when vendor/rails is not
→ /public/dispatch.rb, dispatch.cgi, and dispatch.fcgi
Edit the first line in all of the dispatch files to look like this:
#!/usr/local/bin/ruby
→ /public/.htaccess
Ok, a brief pause is needed here to explain some things. .htaccess
files are generally used for many reasons, but it’s common in shared
hosting for these
files to be used to redirect to a subdirectory preventing users from
knowing the real location of your application on a server. GoDaddy
uses a 'Symbolic Link
name’ which is really just an ‘alias’. So in our case we’re going to
create a subdirectory called ‘helloworld_godaddy’ and a Symbolic Link
name of
subdirectory. The most important thing to know about this file is that
it should contain a ‘RewriteBase’ directive which explicitly sets the
base URL for
per-directory rewrites. So in our case we want the base URL to be
rewritten as ‘helloworld’. Another useful tip is to use the .fcgi
(FastCGI) protocol; this
is done by simply changing the .cgi extensions to .fcgi.
Edit the middle section of the .fcgi file to look like this:
Ok, now we’re almost there! The last part is the easiest
Lock and Load
Log into your GoDaddy account and open up the CGI Admin tool.
In the ‘Directory name:’ textbox, type my_rails_apps. GoDaddy will
automatically create an .htaccess file in the new directory. Open the
file and change
dispatch.cgi to dispatch.fcgi. [Note: This step is not necessary]
Open up FileZilla and connect to your GoDaddy root directory. Double
click the my_rails_apps directory.
In the Filezilla toolbar, select Edit → Settings → FileTypes and
change the Default transfer type to ASCII.
Select your helloworld_godaddy directory, right click and select
upload. *** IMPORTANT STEP ***
[Note: this process will take about 2-3 minutes]
(If you’re new to the GoDaddy admin tool, you’ll need to create an FTP
user by going to Hosting Control Center → Settings → Manage FTP
settings)
(To figure out your FTP URL, username and password, go to Hosting
Control Center → Content → FTP Client → Click Disconnect, then
Connect)
(Make sure you turn on your error logs, go to Hosting Control Center –
Settings → Error Logs → click the ‘Update’ button)
Ok, now go back to the CGI Admin tool and select the ‘Ruby’ tag or
refresh the page.
In the Create Rails Symbolic Link section, click the Show Rails
‘Applications link’.
If all went well, you should see ‘my_rails_apps/helloworld_godaddy’ in
the ‘Choose a rails app:’ drop down box.
Enter a link name of ‘hellworld’ (no quotes), then click the ‘Create’
button.
[Link created: helloworld is a symbolic link to my_rails_apps/
helloworld_godaddy]
LIFT OFF!!
The very last step is setting permissions.
Reconnect to your root directory via Filezilla and open up the /
my_rails_apps/helloworld_godaddy/public directory.
Select the dispatch.cgi and dispatch.fcgi file, right click and select
‘file attributes’. Change the numeric value 644 to 755 and click the
‘Ok’ button.