foreman only shows line with “started wit pid #” and nothing else

When I run foreman I get the following:

 > foreman start
 16:47:56 web.1     | started with pid 27122

Only if I stop it (via ctrl-c) it shows me what is missing:

^CSIGINT received
16:49:26 system    | sending SIGTERM to all processes
16:49:26 web.1     | => Booting Thin
16:49:26 web.1     | => Rails 3.0.0 application starting in development on http://0.0.0.0:5000
16:49:26 web.1     | => Call with -d to detach
16:49:26 web.1     | => Ctrl-C to shutdown server
16:49:26 web.1     | >> Thin web server (v1.3.1 codename Triple Espresso)
16:49:26 web.1     | >> Maximum connections set to 1024
16:49:26 web.1     | >> Listening on 0.0.0.0:5000, CTRL+C to stop
16:49:26 web.1     | >> Stopping ...
16:49:26 web.1     | Exiting
16:49:26 web.1     | >> Stopping ...

How do I fix it?

Solr match phrase only when field contains nothing else

How do I get Solr to only match a field with a given phrase and nothing else? e.g. myfield:contact lens should match contact lenses but not soft contact lenses? Edit: Note in the above example that

Faye server not started by foreman

I am trying to start faye with foreman. My procfile lookd like this: web: bundle exec rails server thin -p $PORT -e $RACK_ENV worker: bundle exec sidekiq redis: bundle exec redis-server faye: bundle e

PHP : tell php if xxx else do nothing

I want to use one line and one if statement. (isset($_COOKIE[‘uid’])) ? delete_cookie($_COOKIE[‘uid’]) : do_nothing; but only one condition, else just do nothing. How can I achieve this?

Select the tds containing a only the “specified text” and nothing else using jQuery

Is there any way that I can select the td containing only the specified text and nothing else? I have tried the following: $(tr td:contains(‘1’)) but it returns the tds having 1 somewhere in text o

AngularJS : only one line shows up, not the other

AngularJS : only one line shows up, not the other I have AngularJS code and only one of them shows up in my page function Today($scope, $timeout) { $scope.now_time = 0; (function update() { $timeout(u

Foreman start results in server error 500

I am following Getting Started with Django on Heroku tutorial to deploy my app. First to test locally, I ran foreman start: | => foreman start 00:47:08 web.1 | started with pid 4465 00:47:09 web.1

glutBitmapString shows nothing

I’m going to show FPS on the screen with the freeglut function glutBitmapString,but it shows nothing. Here is my code. Is there anyone can figure where the problem is? void PrintFPS() { frame++; time=

glut window shows nothing

I’m trying to create a simple project using freeglut. Well all my previous projects were working before but new one shows nothing in window. I don’t understand why. There I initialize glut int main(in

Get pid of started process c++

I try to get PID of process which i started by my app. DWORD dwPid = GetProcessId(pi.hProcess); Somewhere on this forum is this solution but i dont have func GetProcessId To start process i’m usin

Foreman exiting immediately with code 1

I am having trouble with getting foreman to work. When I run foreman start, I get the following output: 13:48:12 web.1 | started with pid 14896 13:48:12 web.1 | Traceback (most recent call last): 13:4

Answers

I have the same problem (ruby 1.9.3-p0, rails 3.2rc2, OSX 10.7).

Resolved the issue by using foreman-0.27.0 by adding this line into my Gemfile.

gem 'foreman', '0.27.0'

I also had the same problem but with a different solution. (ruby 1.9.2p290, rails 3.1.0, ubuntu 10.04.3)

I changed the line in my Procfile from:

web: bundle exec thin start -p $PORT

to:

web: bundle exec rails server thin -p $PORT

and it no longer gave me an issue.

“Foreman will display to the terminal output anything written to stdout by the processes it launches.” – ddollar See foreman-issues#57

BTW, you can use tailf into Procfile to see logs

web: bundle exec rails server thin -p $PORT
log: tail -f log/development.log

Tip: tailf doesn’t exist in OSX, using tail -f -n 40 log/development.log works.

I’ve been able to resolve this issue by 2 different ways:

  1. From https://github.com/ddollar/foreman/wiki/Missing-Output:

    If you are not seeing any output from your program, there is a likely chance that it is buffering stdout. Ruby buffers stdout by default. To disable this behavior, add this code as early as possible in your program:

    # ruby
    $stdout.sync = true
    
  2. By installing foreman via the heroku toolbelt package

But I still don’t know what’s happening nor why this 2 ways above resolved the issue…

My solution was to put $stdout.sync = true at the top of config/environments/development.rb.

Then everything that loads the development environment (incluing thin) will not buffer stdout.

If you are using Foreman to run a Python project, rather than a Ryby project, and you’re having the same issue, here are some solutions for you. If you are using a Procfile to invoke the python CLI directly, then you can use the ‘-u’ option to avoid stdout buffering:

python -u script.py

If you are using a Procfile to manage a WSGI server, such as invoking gunicorn, flask, bottle, eve, etc., then you can add a “.env” file to the root of your python project, containing the following:

PYTHONUNBUFFERED=True