简体   繁体   中英

Unicorn fails to start rails app mac

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM