Error starting wizard (server.rb: 33, missing argument ...)

After trying to start the wizard, I get this error (note that it works on the hero, although I assume that this is a strictly local problem):

hrn039:textthechange jon$ foreman start 02:20:00 web.1 | started with pid 7363 02:20:01 web.1 | /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands/server.rb:33:in `parse!': missing argument: -e (OptionParser::MissingArgument) 02:20:01 web.1 | from /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:280:in `parse_options' 02:20:01 web.1 | from /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:180:in `options' 02:20:01 web.1 | from /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands/server.rb:54:in `set_environment' 02:20:01 web.1 | from /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands/server.rb:42:in `initialize' 02:20:01 web.1 | from /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:50:in `new' 02:20:01 web.1 | from /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>' 02:20:01 web.1 | from script/rails:6:in `require' 02:20:01 web.1 | from script/rails:6:in `<main>' 02:20:01 web.1 | process terminated 02:20:01 system | sending SIGTERM to all processes 

There is only one line in the Procfile : specified by heroku

 web: bundle exec rails server thin -p $PORT -e $RACK_ENV 

And my gemfile has

 gem 'thin' 

Google doesn't really help with this error.

Thanks!

+8
ruby-on-rails heroku foreman thin
source share
3 answers

This is not about execution on Heroku - see that the original question about execution with Foreman is local execution.

You can replicate your error by doing the following:

rails server thin -e

Effectively what Foreman works, considering your Procfile:

web: bundle exec rails server thin -p $ PORT -e $ RACK_ENV

So, I'm going to assume that you are not passing the -e argument. i.e. You did not specify RACK_ENV locally.

What you can do is create an .env file in your local directory, something like

RACK_ENV = development

PORT = 3000

Foreman will automatically select the local .env file and configure the environment accordingly before creating a process based on a process type declaration.

+21
source share

I had the same problem with rails v3.2 on Ubuntu 10.04. I managed to get a subtle move by following these steps:

  • Modify your Procfile as follows:

    web: bundle exec rails server thin -p $ PORT -e development

  • Add $stdout.sync = true at the top of your config.ru file to directly output the server to your terminal (otherwise you will not receive output in your terminal)

Tell me if it works!

0
source share

I ran into this problem. If you change your Procfile only to

 web: bundle exec rails server thin -p $PORT 

he should work. Please note: the default thin port is 5000, not 3000 (this means that you need to go to http: // localhost: 5000 to see your application.

Having only

 web: bundle exec rails server thin 

your Procfile will use port 3000, but this will cause errors in Heroku.

0
source share

All Articles