3

I have a locally developed Rails application. It is very simple, with no database but only a controller that accesses Facebook data and renders them in view. By the way, gem RestGraph is used.

Before I push this application to heroku, I used foreman start to test it. Since I was using WEBrick before I need to install 'thin' gem and create a Procfile which reads:

web: bundle exec thin start -R config.ru -e $RACK_ENV -p $PORT

an '.env' file seems also required, which reads:

RACK_ENV=development
PORT=3000

The 'config.ru' file is generate by rails, which reads:

require ::File.expand_path('../config/environment',  __FILE__)
run Myapp::Application

Now I entered 'foreman start', but all I get is one line:

15:33:18 web.1     | started with pid 27143

The server will not boot. And if I force terminate it, the error is:

/usr/local/foreman/lib/foreman/engine.rb:141: [BUG] rb_sys_fail() - errno == 0

Which is not very helpful.

yongtw123
  • 371
  • 8
  • 19
  • Is your application called foreman or are you using [The Foreman](http://theforeman.org/) rails app to controll Puppet? – Augusto May 18 '12 at 08:02
  • 1
    The application is just 'Myapp', and no, 'foreman start' is used to test Rails application before deploying on heroku, as described here https://devcenter.heroku.com/articles/rails3#webserver – yongtw123 May 18 '12 at 08:05
  • It will be this 'Foreman' - https://github.com/ddollar/foreman – John Beynon May 18 '12 at 08:30

2 Answers2

1

It may be that instead of being "stuck," your log is just being buffered: foreman only shows line with “started wit pid #” and nothing else

I solved that issue by adding

$stdout.sync = true

to config.ru

Then you might get more helpful feedback from Foreman.

Community
  • 1
  • 1
Dreyfuzz
  • 486
  • 2
  • 13
0

This seems a little over complex. From looking at a couple of apps I have I have the following in my procfile:

bundle exec rails server thin -p $PORT

I also don't have a .env file in these instances.

One thing worth noting is that Foreman will ignore the port you pass in most of the time, it likes to sit in a port range higher than 5000

Neil Middleton
  • 22,105
  • 18
  • 80
  • 134