Hi,
I'm trying to use unicorn in a test deployment of a Rails app that
uses Mongoid, so Activerecord isn't included in the app. When I start
unicorn through Capistrano though, the stderr log fills up endlessly
with identical ActiveRecord-related errors:
I, [2012-12-05T04:19:25.375952 #5096] INFO -- : Refreshing Gem list
I, [2012-12-05T04:19:32.941249 #5096] INFO -- : listening on
addr=/var/www/webapps/fugu-cp/shared/pids/unicorn.sock fd=11
I, [2012-12-05T04:19:32.990825 #5096] INFO -- : master process ready
E, [2012-12-05T04:19:33.108183 #5110] ERROR -- : uninitialized
constant ActiveRecord (NameError)
/var/www/webapps/fugu-cp/current/config/unicorn.rb:68:in `block in reload'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:569:in
`call'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:569:in
`init_worker_process'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:593:in
`worker_loop'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:491:in
`spawn_missing_workers'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:141:in
`start'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/bin/unicorn_rails:209:in
`<top (required)>'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/bin/unicorn_rails:23:in `load'
/var/www/webapps/fugu-cp/shared/bundle/ruby/1.9.1/bin/unicorn_rails:23:in
`<main>'
This repeats until I kill Unicorn.
If you're curious, the way I'm starting Unicorn in the deploy file is
as follows:
set :unicorn_rails, "#{deploy_to}/shared/bundle/ruby/1.9.1/bin/unicorn_rails"
run "cd #{latest_release} && bundle exec \"#{unicorn_rails} -c
#{deploy_to}/current/config/unicorn.rb -D -E #{rails_env}\""
Incidentally, if there's a standard Unicorn include file for
Capistrano so I don't have to specify my own tasks to start and stop
it, I'd be grateful to know, because I couldn't find one and had to
use a very heavily-modified version of something I copied+pasted from
this gist: https://gist.github.com/1003099
Thanks,
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying