0

I have a rails 4 app that runs fine in development on my macbook.
I have followed what seems like a very detailed tutorial on how to deploy the application using:

  • Ubuntu 14.04 LTS
  • Nginx
  • Passenger
  • Rails 4.1.5
  • Ruby 2.1.2
  • RVM

It seems the rails application is failing to load based on this error here.

... but I am a bit lost. The message "No such file to load -- Sequence (LoadError)" and subsequent detail don't seem to indicate which thing did not load.

bundle install

and

rake db:migrate

... work fine.

/usr/bin/passenger-config validate-install

... says all is well too.

Review of the Nginx error log yield this exerpt, but I am not sure where it should lead me:

Could not spawn process for application /var/www/mymri/code: An error occurred while starting up the preloader.

I have enabled friendly errors for Nginx. This produces a lot of other related information, some of which I probably should not share.

What should I check next to troubleshoot this problem?

EDIT1:

This SO answer does not work for me. I have confirmed that passenger is running as the same user that owns the files in the application code directory. I think passenger is finding the rails application correctly, but the application is failing to load some dependancy.

Community
  • 1
  • 1
Perry Horwich
  • 2,798
  • 3
  • 23
  • 51
  • Possible typo on line 2 of `institutions_controller.rb`. Post the first few lines if you don't already see it. – Substantial Apr 29 '16 at 11:40
  • Yes. I had a require 'filename' at that location. Commented it out and it works fine now. Can't recall why I put it there. Don't know why it works in development, but not production. Thanks for your help. I sometimes look at the lengthy stack dumps in the rails error messages and wonder where to go next. I suppose this sort of trial and error is the teacher. Thanks again. – Perry Horwich Apr 29 '16 at 16:19

1 Answers1

0

I had a

require 'filename'

... at that location. Commented it out and it works fine now. Can't recall why I put it there. Don't know why it works in development, but not production. I sometimes look at the lengthy stack dumps in the rails error messages and wonder where to go next. I suppose this sort of trial and error is the teacher. The tip-off here was in line #7 of 49 in the error stackdump where it says,

/var/www/mymri/code/app/controllers/institutions_controller.rb:2:in '< class:InstitutionsController >'

My thanks to https://stackoverflow.com/users/1153362/substantial

Community
  • 1
  • 1
Perry Horwich
  • 2,798
  • 3
  • 23
  • 51