Question

I followed this tururial: https://blog.heroku.com/archives/2013/2/27/unicorn_rails

When running the commant "foreman start" within Terminal, I get:

13:46:03 web.1  | started with pid 14964
13:46:04 web.1  | /usr/local/rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/bin/unicorn:110:in `block in <top (required)>': invalid argument: -p -c (OptionParser::InvalidArgument)
13:46:04 web.1  |   from /usr/local/rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/bin/unicorn:10:in `new'
13:46:04 web.1  |   from /usr/local/rvm/gems/ruby-2.1.0/gems/unicorn-4.8.2/bin/unicorn:10:in `<top (required)>'
13:46:04 web.1  |   from /usr/local/rvm/gems/ruby-2.1.0/bin/unicorn:23:in `load'
13:46:04 web.1  |   from /usr/local/rvm/gems/ruby-2.1.0/bin/unicorn:23:in `<main>'
13:46:04 web.1  |   from /usr/local/rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
13:46:04 web.1  |   from /usr/local/rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
13:46:04 web.1  | exited with code 1
13:46:04 system | sending SIGTERM to all processes
SIGTERM received

The server fails to run. What is causing this? I am in the correct app directory.

Was it helpful?

Solution

It looks like the port is not set in your local environment. Try running with this command instead:

foreman start PORT=3000

In Heroku, this must be getting set for you, and they may have overlooked it in the tutorial.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top