Search code examples
ruby-on-railsserverproduction-environment

Rails server doesn't start in production


I'm trying to start my first production rails server on DigitalOcean but after

$ rails server — binding=my_Droplet_ip_address

i get this error

Exiting
/home/username/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:78:in `require': cannot load such file -- rack/handler/— (LoadError)
from /home/glaux/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:78:in `try_require'
    from /home/glaux/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/handler.rb:16:in `get'
    from /home/glaux/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:290:in `server'

And so on.

App works fine locally and simple rails s on server also works fine.

I have Ubuntu 14.04 server with postgres, nginx and passenger.

I'm a complete newbie to it and I may have missed something important. So tell me if you want me to provide any other info on this matter.


Solution

  • Just try rails s -b 0.0.0.0 And stop previous port 3000 used by rails

    To stop previous port. Try this command Lsof wni -p 3000

    If you are running on 3000 port