Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passenger Rails 4 App Startup = Uninitialized Constant ActiveModel::Serializer

I know this is an odd request, but I am new to passenger and I can not determine where to troubleshoot his error. Cap deploys to the server just fine, but the application will not start up, even after a reboot. Where do I begin?

Also, this is the passenger.log. The application development.log is completely empty.

I should add this is a ubuntu 12.04 server I am accessing remotely. We use cap for deployment and chef to setup the box. If you are wondering, I already reviewed this link: https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems

deploy@apitest:/home/apps/digest/current/log$ tail -f passenger.log
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:105:in `eval'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:105:in `preload_app'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:150:in `<module:App>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:28:in `<main>'

[ 2014-04-17 20:08:52.1202 2620/7f2f2407a700 Pool2/Spawner.h:738 ]: [App 6300 stdout]
[ 2014-04-17 20:08:55.1191 2620/7f2f2407a700 Pool2/Implementation.cpp:849 ]: Could not spawn process for group /home/apps/digest/current#default: An error occured while starting up the preloader.
     in 'void Passenger::ApplicationPool2::SmartSpawner::handleErrorResponse(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:455)
     in 'std::string Passenger::ApplicationPool2::SmartSpawner::negotiatePreloaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:558)
     in 'void Passenger::ApplicationPool2::SmartSpawner::startPreloader()' (SmartSpawner.h:206)
     in 'virtual Passenger::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::SmartSpawner::spawn(const Passenger::ApplicationPool2::Options&)' (SmartSpawner.h:744)
     in 'void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const Passenger::ApplicationPool2::SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned int)' (Implementation.cpp:782)

[ 2014-04-17 20:08:55.1194 2620/7f2f22155700 agents/HelperAgent/RequestHandler.h:1975 ]: [Client 20] Cannot checkout session. An error occured while starting up the preloader.
Error page:
uninitialized constant ActiveModel::Serializer (NameError)
  /home/apps/digest/releases/20140418000553/app/serializers/v1/category_serializer.rb:2:in `<module:V1>'
  /home/apps/digest/releases/20140418000553/app/serializers/v1/category_serializer.rb:1:in `<top (required)>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:347:in `eager_load!'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
  /opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
  /opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
  /opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
  /opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
  /opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
  /opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
  /opt/rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
  /home/apps/digest/releases/20140418000553/config/environment.rb:7:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:105:in `eval'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:105:in `preload_app'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:150:in `<module:App>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /home/apps/digest/shared/bundle/ruby/2.0.0/gems/passenger-4.0.20/helper-scripts/rack-preloader.rb:28:in `<main>'
like image 386
Chris Hough Avatar asked Apr 18 '14 00:04

Chris Hough


1 Answers

I noticed: uninitialized constant ActiveModel::Serializer (NameError)

This is the active_model_serializers gem.

It looks like it isn't installed or in the Gemfile. I've seen this happen (with other gems) that I have installed locally on my dev box but forgot to include in the Gemfile.

like image 110
Shawn Balestracci Avatar answered Oct 02 '22 00:10

Shawn Balestracci