Michael Victor
Michael Victor

Reputation: 891

504 : Gateway Time-out Error when accessing rails app on Production

I'm using Ruby 2.1.1 Rails 4.1.0 Unicorn

It's set up on a digital ocean droplet

And this is the error I found on

I, [2013-12-20T02:08:31.304781 #4461]  INFO -- : listening on addr=127.0.0.1:8080 fd=3
I, [2013-12-20T02:08:31.305210 #4461]  INFO -- : worker=0 spawning...
I, [2013-12-20T02:08:31.305476 #4461]  INFO -- : worker=1 spawning...
I, [2013-12-20T02:08:31.305785 #4461]  INFO -- : master process ready
I, [2013-12-20T02:08:31.308891 #4463]  INFO -- : worker=1 spawned pid=4463
/home/rails/config/boot.rb:4:in `require': no such file to load -- bundler/setup (LoadError)
    from /home/rails/config/boot.rb:4
    from /home/rails/config/application.rb:1:in `require'
    from /home/rails/config/application.rb:1
    from /home/rails/config/environment.rb:2:in `require'
    from /home/rails/config/environment.rb:2
    from config.ru:4:in `require'
    from config.ru:4
    from /usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `instance_eval'
    from /usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `initialize'
    from config.ru:1:in `new'
    from config.ru:1

The contents of bootfile.rb seem to be default one that all rails applications have.

The rails app works perfectly on Web Brick on development.

Upvotes: 1

Views: 1443

Answers (2)

Richard Peck
Richard Peck

Reputation: 76784

You'll need to install the bundler gem, as this is what Rails is complaining about:

if you SSH into your server, you should type gem bundle install in your /home/rails folder. However, you may also want to verify you're using the correct version of Ruby, as mentioned by Nikhil

Upvotes: 0

Nikhil
Nikhil

Reputation: 3152

This could be one of two issues:

  1. Bundler isn't installed - In this case simply run 'gem install bundler'

  2. You're using two different ruby installations or rubygems installations for your app than your development environment and the gemset for your production app doesn't include bundler.

If you're using RVM, try "rvm use 2.x.x" (or whatever version it is you're using) followed by a bundle install.

Upvotes: 1

Related Questions