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
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> > ---------------------------------------- > Jim Jeffers > "A trustworthy individual." > www.DontTrustThisGuy.com > (480) 235-5201 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Jon Smirl jonsmirl@gmail.com
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 On Jan 14, 2006, at 6:33 PM, Jon Smirl wrote:> 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 > >> >> ---------------------------------------- >> Jim Jeffers >> "A trustworthy individual." >> www.DontTrustThisGuy.com >> (480) 235-5201 >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > -- > Jon Smirl > jonsmirl@gmail.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
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) -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Jim Jeffers Sent: Sunday, January 15, 2006 8:10 PM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Dreaded Internal 500 Error on DreamHost. 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 On Jan 14, 2006, at 6:33 PM, Jon Smirl wrote:> 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 > >> >> ---------------------------------------- >> Jim Jeffers >> "A trustworthy individual." >> www.DontTrustThisGuy.com >> (480) 235-5201 >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > -- > Jon Smirl > jonsmirl@gmail.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
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 On Jan 15, 2006, at 9:10 PM, Jim Jeffers wrote:> 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 > > On Jan 14, 2006, at 6:33 PM, Jon Smirl wrote: > >> 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 >> >>> >>> ---------------------------------------- >>> Jim Jeffers >>> "A trustworthy individual." >>> www.DontTrustThisGuy.com >>> (480) 235-5201 >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >> >> >> -- >> Jon Smirl >> jonsmirl@gmail.com >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
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 On 1/16/06, Jim Jeffers <rails@donttrustthisguy.com> wrote:> 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 > > On Jan 15, 2006, at 9:10 PM, Jim Jeffers wrote: > > > 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 > > > > On Jan 14, 2006, at 6:33 PM, Jon Smirl wrote: > > > >> 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 > >> > >>> > >>> ---------------------------------------- > >>> Jim Jeffers > >>> "A trustworthy individual." > >>> www.DontTrustThisGuy.com > >>> (480) 235-5201 > >>> > >>> _______________________________________________ > >>> Rails mailing list > >>> Rails@lists.rubyonrails.org > >>> http://lists.rubyonrails.org/mailman/listinfo/rails > >>> > >> > >> > >> -- > >> Jon Smirl > >> jonsmirl@gmail.com > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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:> 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 > > On Jan 15, 2006, at 9:10 PM, Jim Jeffers wrote: > > > 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 > > > > On Jan 14, 2006, at 6:33 PM, Jon Smirl wrote: > > > >> 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 > >> > >>> > >>> ---------------------------------------- > >>> Jim Jeffers > >>> "A trustworthy individual." > >>> www.DontTrustThisGuy.com > >>> (480) 235-5201 > >>> > >>> _______________________________________________ > >>> Rails mailing list > >>> Rails@lists.rubyonrails.org > >>> http://lists.rubyonrails.org/mailman/listinfo/rails > >>> > >> > >> > >> -- > >> Jon Smirl > >> jonsmirl@gmail.com > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > 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
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:> 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: > > 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 > > > > On Jan 15, 2006, at 9:10 PM, Jim Jeffers wrote: > > > > > 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 > > > > > > On Jan 14, 2006, at 6:33 PM, Jon Smirl wrote: > > > > > >> 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 > > >> > > >>> > > >>> ---------------------------------------- > > >>> Jim Jeffers > > >>> "A trustworthy individual." > > >>> www.DontTrustThisGuy.com > > >>> (480) 235-5201 > > >>> > > >>> _______________________________________________ > > >>> Rails mailing list > > >>> Rails@lists.rubyonrails.org > > >>> http://lists.rubyonrails.org/mailman/listinfo/rails > > >>> > > >> > > >> > > >> -- > > >> Jon Smirl > > >> jonsmirl@gmail.com > > >> _______________________________________________ > > >> Rails mailing list > > >> Rails@lists.rubyonrails.org > > >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > 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 >-- http://brantinteractive.com rbrant@brantinteractive.com 4034 skippack pike v. 267.640.2195 f. 215.689.1454