Forum: Ruby on Rails Dreaded Internal 500 Error on DreamHost.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B614e42d18c609ac4585d0aa0b13d856?d=identicon&s=25 Jim Jeffers (Guest)
on 2006-01-15 01:40
(Received via mailing list)
Hey guys,

I often get this problem the first time I try to deploy a rails app
on dreamhost and I'm not sure what the cause is.  Basically, I have
an app that's running fine on my local machine.  I've uploaded the
app, configured and migrated to the latest version of the db, and set
all of the necessary directories to 755.  But when I run dispatch.rb
in ssh or access the site from a web browser it returns an Internal
500 error.  I have no errors in my logs.  Any ideas?

----------------------------------------
Jim Jeffers
"A trustworthy individual."
www.DontTrustThisGuy.com
(480) 235-5201
67cb6fef42a83929955ce5a5b3f33f6e?d=identicon&s=25 Jon Smirl (Guest)
on 2006-01-15 02:34
(Received via mailing list)
On 1/14/06, Jim Jeffers <rails@donttrustthisguy.com> wrote:
> Hey guys,
>
> I often get this problem the first time I try to deploy a rails app
> on dreamhost and I'm not sure what the cause is.  Basically, I have
> an app that's running fine on my local machine.  I've uploaded the
> app, configured and migrated to the latest version of the db, and set
> all of the necessary directories to 755.  But when I run dispatch.rb
> in ssh or access the site from a web browser it returns an Internal
> 500 error.  I have no errors in my logs.  Any ideas?

In panel.dreamhosters.com under Manage Domains, did you change Web
Directory to public or current/public (if using switchtower)?

Did you edit .htaccess to change .cgi to .fcgi? Make sure you don't
stomp that with later uploads.

cd in public and do ./dispatch.fcgi it should run and give you and
Error 500 which is normal. If you get a compiler error you have
problems.

Look in ~/logs for errors from Apache

> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Jon Smirl
jonsmirl@gmail.com
B614e42d18c609ac4585d0aa0b13d856?d=identicon&s=25 Jim Jeffers (Guest)
on 2006-01-16 05:13
(Received via mailing list)
My apache log files show I'm getting this error:

Error 500/Premature end of script headers

The dreamhost wiki says:
Troubleshooting: Error 500/Premature end of script headers

1. Make sure that the public directory and dispatch.cgi inside it are
not world-writable (chmod 755). If the problem remains, try running
dispatch.cgi from the command line.

2. You may also get the error: "Rails application failed to start
properly" which seems to be indicative of the same issue. You will
have to chmod all directories in your rails application directory as
well as public to 755.

3. Also, at least with the new rails 0.13.1, you shouldn't have to
make any edits at all to the .htaccess file that is created if you
followed the rest of the directions on this page. You should at least
be able to get the basic rails app working.

The entire site directory has now been recursively set to 755.  What
else can I do?  I'm totally stumped here :(  9 hours to write a nice
app.  3 days to deploy it?  I'm dying here guys help!!

----------------------------------------
Jim Jeffers
"A trustworthy individual."
www.DontTrustThisGuy.com
(480) 235-5201
3f900b38ec3b2c45427c354722fa4ce3?d=identicon&s=25 Tom Fakes (tomfakes)
on 2006-01-16 05:16
(Received via mailing list)
Did you develop your code on Windows?  If so, make sure your end of line
character is set correctly in the dispatch.fcgi file (open it in a Linux
editor, make a change and save it)
B614e42d18c609ac4585d0aa0b13d856?d=identicon&s=25 Jim Jeffers (Guest)
on 2006-01-16 05:19
(Received via mailing list)
Arg! Just as I get frustrated to all end I've found my answer. It was
my shebang line.  The default one rails uses is not friendly with DH.

----------------------------------------
Jim Jeffers
"A trustworthy individual."
www.DontTrustThisGuy.com
(480) 235-5201
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2006-01-16 14:33
(Received via mailing list)
When you run the 'rails' command to generate your application
(including the dispatcher code) it uses the path of the instance of
ruby currently running to generate the #! line. So unless you are
running ruby from /usr/bin/ruby1.8 (which is what I believe Dreamhost
has as their default ruby 1.8 binary), you'll always have this
problem.

I'm not sure what support DH has for using #!/usr/bin/env ruby, but if
that does work you should be able to use it cross-platform with
reasonable success.

- james
E60d9806a7a4e03b401a632aa0d5c9bd?d=identicon&s=25 Rich Brant (Guest)
on 2006-01-24 22:35
(Received via mailing list)
Hi Jim, I'm where your were right now:  What did you change your
shebang to? thanks!

On 1/15/06, Jim Jeffers <rails@donttrustthisguy.com> wrote:
>
> >
> > The entire site directory has now been recursively set to 755.
> >
> >>> 500 error.  I have no errors in my logs.  Any ideas?
> >>
> >>> Rails mailing list
> >> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
http://brantinteractive.com
rbrant@brantinteractive.com
4034 skippack pike
v. 267.640.2195
f. 215.689.1454
786aca6b4728622a57a2c34fb1c9f0cd?d=identicon&s=25 Rich Brant (Guest)
on 2006-01-24 23:51
(Received via mailing list)
nevermind... my permissions were wrong on the public directory. They
actually looked right, but i reset them and i'm up and running.

On 1/24/06, Rich Brant <rbrant@brantinteractive.com> wrote:
> > www.DontTrustThisGuy.com
> > >
> > > make any edits at all to the .htaccess file that is created if you
> > > www.DontTrustThisGuy.com
> > >>> app, configured and migrated to the latest version of the db, and
> > >>
> > >>> www.DontTrustThisGuy.com
> > >> Jon Smirl
> >
> 4034 skippack pike
> v. 267.640.2195
> f. 215.689.1454
>


--
http://brantinteractive.com
rbrant@brantinteractive.com
4034 skippack pike
v. 267.640.2195
f. 215.689.1454
This topic is locked and can not be replied to.