PDA

View Full Version : Help Starting Up Rails



mdgrech
05-07-2009, 11:05 PM
Trying to create my first rails app, and running into a 404. Heres what I've done so far:

mkdir ~/rails
cd ~/rails
rails interviews
ln -s ~/rails/interviews/public ~/public_html/mdgrech/interviews
chmod 755 ~/rails/interviews/public

The app is up and running at www.mdgrech.com/interviews (http://mdgrech.com/interviews) but if you click on the "about application environment" you get a 404 so something must be wrong. Please help.

ps I did try the placing a .htaccess in ~/rails/interviews but that resulted in a 500 error

atoms
05-08-2009, 11:10 AM
Currently I'm getting a 404 at www.mdgrech.com/interviews also.

It looks like you are already following these instructions except for the parts about using a subdomain?
http://helpdesk.hostmonster.com/kb/index.php?x=&mod_id=2&root=35&id=232

I used those instructions to get started (including a subdomain) and its working for me.

http://clbot.atoms.net

edited: Have you examined your rails logs? There might be something helpful in there...

mdgrech
05-08-2009, 01:11 PM
yah I had placed that .htaccess file in my ~/rails/interviews/public directory and it resulted in a 500 error. Any ideas?

atoms
05-08-2009, 01:54 PM
What does [your rails doc root]/logs/development.log say?

mdgrech
05-08-2009, 01:57 PM
This .htaccess found here http://www.hostmonsterforum.com/showthread.php?p=26457#post26457 did the trick. Has anyone been able to set this up not using a subdomain??

static
05-08-2009, 04:32 PM
Hi all

doing a standard test application, linking it to subdomain and using the .htaccess file link to above
also, i had to steal the dispatch.fcgi, dispatch.cgi, etc files from the rails app created using cpanel

first questions: where are you guys getting your dispatch.* files from? rails <app> command doesn't generate them.
EDIT: i took the dispatch.* files from ./.gem/ruby/1.8/gems/rails-2.3.2/dispatches

second: i get this error: "We're sorry, but something went wrong." , which is pretty generic, and there is nothing in development.log

any help? is there any way to debug this? any other logs i should look into?

mdgrech
05-08-2009, 05:29 PM
mm thats strange rails generated the dispatch files for me automatically. after that I just chmod 755 ~/rails/application_name/public

static
05-08-2009, 05:55 PM
mm thats strange rails generated the dispatch files for me automatically. after that I just chmod 755 ~/rails/application_name/public

indeed strange, running rails <app name> or creating a RoR application using cPanel, none of those generate the dispatch.* files for me

mdgrech
05-08-2009, 05:58 PM
Im sorry I didnt realize you were using cpanel...yah the cpanel rails application thing is a joke...it doesnt work...I called support and they pretty much tell you that you have to buy a dedicated ip...I was very angry. talk about false advertising. anyhow follow this tutorial:

http://www.binarymethod.com/content/devblog_files/018d4d34a7b9eb4578e4b8bb2796fdbc-3.php

static
05-08-2009, 07:59 PM
Im sorry I didnt realize you were using cpanel...yah the cpanel rails application thing is a joke...it doesnt work...I called support and they pretty much tell you that you have to buy a dedicated ip...I was very angry. talk about false advertising. anyhow follow this tutorial:

http://www.binarymethod.com/content/devblog_files/018d4d34a7b9eb4578e4b8bb2796fdbc-3.php

thanks! but unfortunately it still doesn't work after following this guide

i changed my .htaccess as they showed and it generated a different error:

"Application error Rails application failed to start properly"

So still no dice

mdgrech
05-08-2009, 11:10 PM
are you trying to install in a subdomain? also did you place the .htaccess in ~/rails/application_name/public/.htaccess? also did you ensure that .htaccess is showing up under ~/public_html/application_name/.htaccess?

Also try a number of different .htaccess files and settings...I had to fiddle with it to get it work. It does piss me off that the whole cpanel thing is such a joke...especially when they advertise that you can do it....you really can't do it...you have to hack it to get it to work.

static
05-09-2009, 08:04 AM
Thanks for your continued effort mdgrech. yes, i am doing it the subdomain way with a soft link, yes .htaccess file is visible. I've tried several .htaccess configurations that i've harvested around and none of them worked (i get different error messages as i change .htaccess files, but all of them are vague and don't really point to a problem)

I am concerned that "rails <app name>" command does NOT generate the dispatch.* files inside /public, while you guys are saying it should do this.
Anyway, i hope the hm support will answer my ticket soon

static
05-09-2009, 08:37 AM
ok, i've gotten a bit closer to identifying the problem:

i noticed that when i change the message in the last line of .htaccess, thats the message that gets shown when i go anywhere witin my rails application

so, this tells me that i get ErrorDocument 500

any ideas on how i should proceed?

static
05-09-2009, 09:19 AM
Almost fixed

so i went to see the error logs in cpanel and this has drawn my attention:

Missing the Rails 2.3.2 gem. Please `gem install -v=2.3.2 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
[Sat May 09 09:14:16 2009] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Sat May 09 09:14:16 2009] [error] [client 99.226.218.220] Premature end of script headers: dispatch.fcgi
[Sat May 09 09:14:18 2009] [error] [client 92.48.127.153] sendmail: No recipients found, aborting..., referer: http://lady-lady.net/cgi-bin/yybbs1/yybbs.cgi
[Sat May 09 09:14:19 2009] [notice] mod_fcgid: process /home1/pandorae/public_html/dresstodance/dispatch.fcgi(29181) exit(communication error), terminated by calling exit(), return code: 1
SUEXEC error_log:
[2009-05-09 09:14:16]: uid: (3233/pandorae) gid: (3233/pandorae) cmd: dispatch.fcgi

So, i've commented out the rails version string in config/environment.rb and it works!

It looks like there is also something up with my fcgi - can anyone on those errors?

atoms
05-09-2009, 10:11 AM
I'm seeing one like this one generated by my rails app - I'm pretty sure it is just informational:

SUEXEC error_log:
[2009-05-09 09:14:16]: uid: (3233/pandorae) gid: (3233/pandorae) cmd: dispatch.fcgi

But I'm not seeing anything like any of the others. Still, if your app is working as you expect it to I'm not sure I'd worry about it (much).

mdgrech
05-09-2009, 03:41 PM
did you have any luck? I know you probably don't want to here this but you might want to look into heroku. Its free hosting for your rails application and you can cname to use your domain name. just a thought atleast seeing as how you having such a difficult time.

http://heroku.com/

btw I used and it worked great