Rails Fails to Start


#1

Hi

Ive installed a basic Skeleton rails app on http://www.ruby.theogml.com/

I followed in instructions to create the dispatch.fcgi and .htaccess files perfectly

i run ./dispatch.fcgi in ssh and it works no errors but when i load up the application i get “Rails application failed to start properly”

i can manually view the default index page but not be routed to it.

I go to log folder to see if i can find the error and log files are empty.

A little confused here[hr]
After troubleshooting a bit i see ps -e is displaying a defunct dispatch.fcgi before it gets killed

i ran ruby debug and got this output maybe it my fcgi that on the dreamhost wiki that fails

ruby --debug dispatch.fcgi Exception `NoMethodError' at /usr/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational Exception `LoadError' at /usr/lib/ruby/1.8/rubygems.rb:1113 - no such file to load -- rubyg ems/defaults/operating_system Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/config_file.rb:50 - no such file to loa d -- Win32API Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- bundler Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File exists - /home/shigi ns/.gems Exception `ArgumentError' at /usr/lib/ruby/gems/1.8/gems/i18n-0.6.0/lib/i18n/core_ext/strin g/interpolate.rb:18 - malformed format string - %{ /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/configuration.rb:33: warni ng: method redefined; discarding old encoding= /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/configuration.rb:91: warni ng: method redefined; discarding old cache_store /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/configuration.rb:105: warn ing: method redefined; discarding old log_level Exception `TypeError' at (eval):4 - can't modify frozen object Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:239 - no such file to load -- json Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:231 - no such file to load -- json Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:239 - no such file to load -- fast_xs Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:231 - no such file to load -- fast_xs Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:239 - no such file to load -- Win32API Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:231 - no such file to load -- Win32API /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @load_path not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @eager_load not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/paths.rb:130: warning: instance variab le @autoload_once not initialized Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:239 - no such file to load -- nested_multimap Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:231 - no such file to load -- nested_multimap Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:239 - no such file to load -- nested_multimap_ext Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:231 - no such file to load -- nested_multimap_ext Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:239 - no such file to load -- regin Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /dependencies.rb:231 - no such file to load -- regin /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/finisher.rb:39: warning: g lobal variable `$rails_rake_task' not initialized Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `middleware_stack' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `_layout' not defined in ActionController::Bas e Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `default_format' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `default_format' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `default_format' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `_helpers' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `middleware_stack' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `_layout' not defined in ApplicationController Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `_helpers' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `middleware_stack' not defined in Class Exception `NameError' at /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support /core_ext/module/remove_method.rb:3 - method `_layout' not defined in PagesController Rack::Mount rehashing Rack::Mount recognition keys - [:request_method, path_info[0].split(/\./)] Rack::Mount generation keys - [:action, :controller] Rack::Mount optimizing recognize ^CException `Interrupt' at /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/fastcgi. rb:24 - /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/fastcgi.rb:24:in `each': Interrupt from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/fastcgi.rb:24:in `run' from dispatch.fcgi:24


#2

after looking into it more … it has to be something with the error message imgetting on the debug for dispatch.fcgi

Here are my .htaccess and .fcgi files

.htaccess

<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 ^(.*)$ dispatch.fcgi/$1 [QSA,L] 
 
ErrorDocument 500 "Rails application failed to start properly (Fast CGI Working)"

dispatch.fcgi ( yes ive changed the user… just changed it back here for security issues on a public forum )

[code]
#!/usr/bin/ruby

require 'rubygems’
require ‘fcgi’

ENV[‘RAILS_ENV’] ||= ‘production’

Set GEM_PATH and GEM_HOME (“user” is your dreamhost user)

ENV[‘GEM_HOME’] ||= '/home/user/.gems’
require 'rubygems’
Gem.clear_paths

require File.join(File.dirname(FILE), ‘…/config/environment’)

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

Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(TheOgml::Application)
[/code][hr]
got it working by booting “rails s” in console and access the application via :3000

but that doesn’t fix it the issue :frowning:


#3

after spending 16 hours working out what was wrong… i find out the in one of the wiki statements that FastCGI is not the recommended option for rails… after turning on passenger all works fine now