So I'm new to Ruby/Rails, and started writing a little app using the latest versions on my own computer. I currently have shared hosting through Dreamhost, and got to a point where I wanted to try and deploy what I have on a subdomain, which I set up using a new user. Unfortunately, I didn't realize that the default version of Ruby and Rails is hopelessly out of date, so I started searching for ways to update it. Some googling and I stumbled across some instructions, which seemed like they should hold the answer:
RAILS 4.0.0 WITH RUBY 2.0 ON A DREAMHOST SHARED SERVER
At first it seems as if it is working, ruby and rails both install fine and start pointing to the newest versions. Unfortunately, when I try to do the final steps and set up a test app, I get a 500 error returned every single time.
Rails application failed to start properly
I went through my directories looking for log files, and found a bunch of the following in my home/user/logs/subdomain.domain.com/http/error.log file:
[Thu Oct 23 15:11:41 2014] [error] [client 24.93.22.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Going through the dreamhost wiki for FCGI and Rails, it was suggested when debugging to run my dispatch.fcgi from the console and see what errors it spits out. When I do that, nothing seems to happen, it's like it gets stuck in an infinite loop somehow until I hit enter a second time, at which point I go back to the command prompt. Here's my dispatch.fcgi file, I don't really understand what's going on in here since I pretty much just copy and pasted it from the first link I posted, I've never had to do anything like this before.
#!/home/user/ruby/bin/ruby
ENV['RAILS_ENV'] = 'development'
ENV['HOME'] ||= `echo ~`.strip
ENV['GEM_HOME'] = File.expand_path('~/.gems')
ENV['GEM_PATH'] = File.expand_path('~/.gems')
require 'fcgi'
require File.join(File.dirname(__FILE__), '../config/environment.rb')
class Rack::PathInfoRewriter
def initialize(app)
@app = app
end
def call(env)
env.delete('SCRIPT_NAME')
parts = env['REQUEST_URI'].split('?')
env['PATH_INFO'] = parts[0]
env['QUERY_STRING'] = parts[1].to_s
@app.call(env)
end
end
Here's my .htaccess file as well that I created and threw in my home/user folder, again, a straight copy/paste job that I don't understand all that well.
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/dispatch.fcgi/$1 [QSA,L]
ErrorDocument 500 "Rails application failed to start properly"
So, I realize that a Dreamhost shared server is probably not the best environment for running Rails, but it's what I have at the moment and if I could get it working, I'd be happy. I'd even settle at this point for just understanding what exactly is going on even if there is no way to fix it, because I've been banging my head against the wall for the better part of today running around the internet trying to figure what exactly I'm doing.