Can't start foreman in Heroku Tutorial using Python

10,447

Solution 1

I had this problem. I fixed it by uninstalling version 0.62 of the foreman gem and installing 0.61.

gem uninstall foreman
gem install foreman -v 0.61

Solution 2

Yes, heroku-toolbelt-installer is not working correctly at present (30-Aug-2013). For windows the following steps worked for me:

  1. uninstall heroku (via windows 'program uninstall')
  2. install heroku https://toolbelt.heroku.com/windows into C:\bin\heroku , i.e. 'no spaces'
  3. install ruby from http://rubyinstaller.org/downloads/
  4. in cmd run "gem install foreman -v 0.61". Yes, "gem install foreman" installed v0.63, which does not work for "foreman start"
  5. in cmd "foreman start" works for the heroku hello-world example

Solution 3

Uninstalling the heroku toolbelt and reinstall it to a path that does not have spaces in it, for example C:\heorku\ will help a bit. Aside from that the heroku windows installer is horribly broken at the moment, not exactly a point of pride for us. To work around the issue with foreman you can set the environment variables your self using export VAR=VALUE and then run your app using what ever commands you put in your procfile.

This is going to improve in the future.

Share:
10,447
user1167662
Author by

user1167662

Updated on July 11, 2022

Comments

  • user1167662
    user1167662 almost 2 years

    I have been attempting to complete this tutorial, but have run into a problem with the foreman start line. I am using a windows 7, 64 bit machine and am attempting to do this in the git bash terminal provided by the Heroku Toolbelt.

    When I enter foreman start I receive:

    sh.exe": /c/Program Files (x86)/Heroku/ruby-1.9.2/bin/foreman: "c:/Program: bad
    interpreter: No such file or directory
    

    So I tried entering the cmd in git bash by typing cmd and then using foreman start (similar to a comment on one of the answers to this question suggests). This is what that produced:

    Bad file descriptor
    c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
    /lib/foreman/engine.rb:377:in `read_nonblock'
    c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
    /lib/foreman/engine.rb:377:in `block (2 levels) in watch_for_output'
    c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
    /lib/foreman/engine.rb:373:in `loop'
    c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
    /lib/foreman/engine.rb:373:in `block in watch_for_output'
    21:06:08 web.1  | exited with code 1
    21:06:08 system | sending SIGKILL to all processes
    

    I have no clue what the second set of errors is trying to tell me, since the file location it seems to claim engine.rb is running from does not even exist on my computer.

    I have looked at other answers to similar problems, however I am not receiving similar errors and so do not believe a solution to my problem currently exists.

  • user1167662
    user1167662 over 11 years
    How should I uninstall it? I can't seem to find any suggested instructions, but when I tried to use the control panel to "remove program" (of "Herkou 2.35.0") it said it couldn't uninstall it and said that it might be because it was already uninstalled?
  • user1167662
    user1167662 over 11 years
    however, would you you happen to know how I can actually view the page now? I tried going to 0.0.0.0 and 0.0.0.0:5000 in my chrome web browser, and I got an error 108. I tried curl 0.0.0.0 and curl 0.0.0.0:5000 in a separate git bash terminal, and those gave me curl: (7) couldn't connect to host. any ideas?
  • user1167662
    user1167662 over 11 years
    ok, I managed to visit it after deploying to heroku, but I am still wondering how I can visist it when testing with foreman?
  • Eric Speelman
    Eric Speelman over 11 years
    If you follow the Heroku guide the website should be running on 127.0.0.1:5000 or localhost:5000
  • Ates Goral
    Ates Goral about 11 years
    The path suggestion didn't help with the "Bad file descriptor" issue.
  • RexE
    RexE almost 11 years
    After I install foreman 0.61, I get this error on "foreman start" 02:54:38 web.1 | started with pid 6504 02:54:38 web.1 | Traceback (most recent call last): 02:54:38 web.1 | File "C:\Python27\Scripts\gunicorn-script.py", line 9, in <module> ...02:54:38 web.1 | File "C:\Python27\lib\site- packages\distribute-0.6.28-py2.7.egg\pkg_resources.py", line 2311, in load_entry_point 02:54:38 web.1 | exited with code 1 02:54:38 system | sending SIGKILL to all processes 02:54:38 | return ep.load()
  • ATSiem
    ATSiem over 10 years
    I had a similar error on Mac... Foreman would not start because the 'command not found' error. I thought it could be a $PATH issues since I just updated to Ruby 1.9.3, but I just installed it with 'foreman start' and I'm all set! Then I ran 'bundle install' to get the remaining gems for my app.
  • swdev
    swdev over 10 years
    Not a good user experience Heroku. This is 2014 and this problem is not fixed. If we can't install it using directory with spaces, just told us so. Now, installing foreman 0.61 still not worked for me, ` ImportError: No module named fcntl' Not cool. So not cool... I think I will use OSX for this. I believe the experience will be different...I hope..
  • swdev
    swdev over 10 years
    what version of Ruby should I use?