# Rails app crashing on dreamhost

**URL:** <https://www.ruby-forum.com/t/rails-app-crashing-on-dreamhost/217485>\
**Category:** Deployment\
**Created:** [March 2, 2012, 8:01pm UTC](https://www.ruby-forum.com/t/rails-app-crashing-on-dreamhost/217485 "2012-03-02T20:01:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 2, 2012, 8:01pm UTC](https://www.ruby-forum.com/t/rails-app-crashing-on-dreamhost/217485/1 "2012-03-02T20:01:31Z")

</div>

Hi All,

Wondering if anybody has seen this issue. I have a rails 3.2 app I am  
trying to host on dreamhost. I am using FastCGI. When I attempt to  
access the site, I get the “Rails application failed to start properly”  
error. I’ve determined that the ruby binary is crashing, and it is  
producing a core file in the public directory of my app. I’ve also  
determined that the crash is happening when the following line in the  
application.rb file is executed:

Bundler.require(\*Rails.groups(:assets =\> %w(development test)))

I have precompiled my assets. I’ve also tried without precompiling  
assets and using the alternate line in application.rb for lazy  
compilation of assets:

Bundler.require(:default, :assets, Rails.env)

I get the same result either way. Note that I’ve put logging into  
application.rb to determine on which line the crash is happening. I get  
the log message from immediately before the lines shown above, but I  
don’t get the log message that immediately follows them.

Below is a backtrace from the core file, along with my .htaccess,  
dispatch.fcgi, and config/application.rb files. Been fighting with this  
since yesterday with no luck. Anybody have a clue as to what could be  
wrong? Thanks for any help.

backtrace of ruby binary from gdb:

(gdb) backtrace  
#0 0x000068a0b474ced5 in raise () from /lib/libc.so.6  
#1 0x000068a0b474e3f3 in abort () from /lib/libc.so.6  
#2 0x000068a0af96c8c9 in v8::internal::OS::Abort () from  
/home/davlev16/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.9.9/ext/v8/v8.so  
#3 0x000068a0af86b183 in API\_Fatal () from  
/home/davlev16/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.9.9/ext/v8/v8.so  
#4 0x000068a0af83e533 in v8::DefaultFatalErrorHandler () from  
/home/davlev16/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.9.9/ext/v8/v8.so  
#5 0x000068a0af83b50b in v8::IsDeadCheck () from  
/home/davlev16/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.9.9/ext/v8/v8.so  
#6 0x000068a0af83c8d9 in v8::V8::AddGCPrologueCallback () from  
/home/davlev16/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.9.9/ext/v8/v8.so  
#7 0x000068a0af835cd5 in Init\_v8 () at v8.cpp:29  
#8 0x0000000000594678 in dln\_load (file=0x2963300  
“/home/davlev16/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.9.9/ext/v8/v8.so”)  
at dln.c:1337  
#9 0x000000000051e505 in rb\_vm\_call\_cfunc (recv=9085920, func=0x57f060  
\<load\_ext\>, arg=25806080, blockptr=0x1, filename=)  
at vm.c:1538  
#10 0x000000000057ff42 in rb\_require\_safe (fname=25819360, safe=0) at  
load.c:623  
#11 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755408, num=1, blockptr=0x1, flag=8, id=9008, me=0x125bf50,  
recv=25763320) at vm\_insnhelper.c:404  
#12 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#13 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#14 0x0000000000526be2 in rb\_iseq\_eval (iseqval=25766280) at vm.c:1447  
#15 0x000000000057ead5 in rb\_load\_internal (fname=25692560, wrap=) at load.c:310  
#16 0x000000000057fe2f in rb\_require\_safe (fname=25667000, safe=0) at  
load.c:619  
#17 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755568, num=1, blockptr=0x1, flag=8, id=9008, me=0x125bf50,  
recv=9085920) at vm\_insnhelper.c:404  
#18 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#19 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#20 0x0000000000526be2 in rb\_iseq\_eval (iseqval=25650640) at vm.c:1447  
#21 0x000000000057ead5 in rb\_load\_internal (fname=25498000, wrap=) at load.c:310  
#22 0x000000000057fe2f in rb\_require\_safe (fname=25491000, safe=0) at  
load.c:619  
#23 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755670, num=1, blockptr=0x1, flag=8, id=9008, me=0x125bf50,  
recv=9085920) at vm\_insnhelper.c:404  
#24 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#25 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#26 0x0000000000526be2 in rb\_iseq\_eval (iseqval=25462800) at vm.c:1447  
#27 0x000000000057ead5 in rb\_load\_internal (fname=25381480, wrap=) at load.c:310  
#28 0x000000000057fe2f in rb\_require\_safe (fname=25371680, safe=0) at  
load.c:619  
#29 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755778, num=1, blockptr=0x1, flag=8, id=9008, me=0x125bf50,  
recv=9085920) at vm\_insnhelper.c:404  
#30 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#31 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#32 0x0000000000526be2 in rb\_iseq\_eval (iseqval=25372840) at vm.c:1447  
#33 0x000000000057ead5 in rb\_load\_internal (fname=25316640, wrap=) at load.c:310  
#34 0x000000000057fe2f in rb\_require\_safe (fname=24966880, safe=0) at  
load.c:619  
#35 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755880, num=1, blockptr=0x1, flag=8, id=9008, me=0x125bf50,  
recv=9085920) at vm\_insnhelper.c:404  
#36 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#37 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#38 0x0000000000526be2 in rb\_iseq\_eval (iseqval=24773880) at vm.c:1447  
#39 0x000000000057ead5 in rb\_load\_internal (fname=18099240, wrap=) at load.c:310  
#40 0x000000000057fe2f in rb\_require\_safe (fname=17799040, safe=0) at  
load.c:619  
—Type to continue, or q to quit—  
#41 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755988, num=1, blockptr=0x1, flag=0, id=9008, me=0x948880,  
recv=9090600) at vm\_insnhelper.c:404  
#42 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#43 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#44 0x000000000052eca9 in rb\_yield (val=13799760) at vm.c:654  
#45 0x0000000000543987 in rb\_ary\_each (array=) at  
array.c:1478  
#46 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755a90, num=0, blockptr=0x68a0b5755ab9, flag=0, id=424,  
me=0x908550, recv=17800120) at vm\_insnhelper.c:404  
#47 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#48 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#49 0x000000000052eca9 in rb\_yield (val=13791320) at vm.c:654  
#50 0x0000000000543987 in rb\_ary\_each (array=) at  
array.c:1478  
#51 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755b98, num=0, blockptr=0x68a0b5755bc1, flag=0, id=424,  
me=0x908550, recv=14261400) at vm\_insnhelper.c:404  
#52 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#53 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#54 0x0000000000526be2 in rb\_iseq\_eval (iseqval=8912200) at vm.c:1447  
#55 0x000000000057ead5 in rb\_load\_internal (fname=8972200, wrap=) at load.c:310  
#56 0x000000000057fe2f in rb\_require\_safe (fname=8974400, safe=0) at  
load.c:619  
#57 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755d50, num=1, blockptr=0x1, flag=8, id=14408, me=0xa94c30,  
recv=9085920) at vm\_insnhelper.c:404  
#58 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#59 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#60 0x0000000000526be2 in rb\_iseq\_eval (iseqval=8975960) at vm.c:1447  
#61 0x000000000057ead5 in rb\_load\_internal (fname=8984360, wrap=) at load.c:310  
#62 0x000000000057fe2f in rb\_require\_safe (fname=8990040, safe=0) at  
load.c:619  
#63 0x000000000051f917 in vm\_call\_method (th=0x845240,  
cfp=0x68a0b5755eb0, num=1, blockptr=0x1, flag=8, id=14408, me=0xa94c30,  
recv=9085920) at vm\_insnhelper.c:404  
#64 0x0000000000520f91 in vm\_exec\_core (th=0x845240, initial=) at insns.def:1015  
#65 0x0000000000526637 in vm\_exec (th=0x845240) at vm.c:1220  
#66 0x00000000005269c0 in rb\_iseq\_eval\_main (iseqval=11133160) at  
vm.c:1461  
#67 0x0000000000417d23 in ruby\_exec\_internal (n=0xa9e0e8) at eval.c:204  
#68 0x0000000000419f96 in ruby\_run\_node (n=) at  
eval.c:251  
#69 0x0000000000416f4d in main (argc=2, argv=0x771ddad45b48) at  
main.c:38  
(gdb)

# ====================================================================== .htaccess file:

[canopus]$ cat .htaccess  
SetEnv GEM\_HOME /home/davlev16/local/lib/ruby/gems/1.9.1  
SetEnv GEM\_PATH /home/davlev16/local/lib/ruby/gems/1.9.1  
SetEnv RUBYOPT ‘-rbundler/setup’

AddHandler fastcgi-script .fcgi  
AddHandler fcgid-script .fcgi  
AddHandler cgi-script .cgi

Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ dispatch.fcgi/$1 [QSA,L]

ErrorDocument 500 “Rails application failed to start properly”  
[canopus]$

# ====================================================================== dispatch.fcgi file:

[canopus]$ cat dispatch.fcgi  
#!/home/davlev16/local/bin/ruby

require ‘logger’  
logger = Logger.new(’/home/davlev16/wm/log/dispatch.log’);  
logger.info “a”  
require ‘rubygems’  
require ‘fcgi’

ENV[‘RAILS\_ENV’] ||= ‘production’

logger.info “b”

# Set GEM\_PATH and GEM\_HOME (“user” is your dreamhost user)

ENV[‘GEM\_HOME’] = ‘/home/davlev16/.gems’  
ENV[‘GEM\_PATH’] =  
‘/home/davlev16/.gems:/home/davlev16/local/lib/ruby/gems/1.9.1’  
require ‘rubygems’  
Gem.clear\_paths

logger.info “c”  
logger.info File.join(File.dirname( **FILE** ), ‘…/config/environment’)  
require File.join(File.dirname( **FILE** ), ‘…/config/environment’)

logger.info “d”  
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

logger.info “e”  
Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Wm::Application)  
logger.info “f”  
[canopus]$

# ====================================================================== application.rb file:

[canopus]$ cat application.rb  
require File.expand\_path(’…/boot’, **FILE** )

require ‘rails/all’

if defined?(Bundler)  
require ‘logger’  
logger = Logger.new(’/home/davlev16/wm/log/application.log’);  
logger.info “A4”

# If you precompile assets before deploying to production, use this

line  
Bundler.require(\*Rails.groups(:assets =\> %w(development test)))

# If you want your assets lazily compiled in production, use this line

# Bundler.require(:default, :assets, Rails.env)

logger.info “A5”  
end

module Wm  
class Application \< Rails::Application  
# Settings in config/environments/\* take precedence over those  
specified here.  
# Application configuration should go into files in  
config/initializers  
# – all .rb files in that directory are automatically loaded.

```
# Custom directories with classes and modules you want to be

```

autoloadable.  
# config.autoload\_paths += %W(#{config.root}/extras)

```
# Only load the plugins named here, in the order given (default is

```

alphabetical).  
# :all can be used as a placeholder for all plugins not explicitly  
named.  
# config.plugins = [ :exception\_notification, :ssl\_requirement, :all  
]

```
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector,

```

:forum\_observer

```
# Set Time.zone default to the specified zone and make Active Record

```

auto-convert to this zone.  
# Run “rake -D time” for a list of tasks for finding time zone  
names. Default is UTC.  
# config.time\_zone = ‘Central Time (US & Canada)’

```
# The default locale is :en and all translations from

```

config/locales/_.rb,yml are auto loaded.  
# config.i18n.load\_path += Dir[Rails.root.join(‘my’, ‘locales’,  
'_.{rb,yml}’).to\_s]  
# config.i18n.default\_locale = :de

```
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"

# Configure sensitive parameters which will be filtered from the log

```

file.  
config.filter\_parameters += [:password]

```
# Use SQL instead of Active Record's schema dumper when creating the

```

database.  
# This is necessary if your schema can’t be completely dumped by the  
schema dumper,  
# like if you have constraints or database-specific column types  
# config.active\_record.schema\_format = :sql

```
# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for

```

mass-assignment for all models  
# in your app. As such, your models will need to explicitly  
whitelist or blacklist accessible  
# parameters by using an attr\_accessible or attr\_protected  
declaration.  
# config.active\_record.whitelist\_attributes = true

```
# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your

```

assets  
config.assets.version = ‘1.0’  
end  
end  
[canopus]$
