0
votes

I am trying to use foreman for heroku. This is what is existing in my setup:

  1. Using a Ubuntu 10.04 machine for installing foreman
  2. Ruby version installed is: 1.9.3-p362
  3. Rubygems version installed is: 1.8.24
  4. I can trigger a sample test.rb file which works fine. Code below:

    root@ubuntu-test:~# cat test.rb
    
    #/usr/local/rvm/rubies/ruby-1.9.3-p362/bin/ruby
    require 'rubygems'
    puts "Hello world!"
    
  5. Created a Gemfile with code:

    source :rubygems
    gem 'sinatra', '1.1.0'
    gem 'thin'
    
  6. Created a Procfile with code: web: bundle exec ruby test.rb -p $PORT

  7. Issued foreman start - which fails as below:

    06:37:09 web.1  | started with pid 3638
    06:37:09 web.1  | .: 39: .profile: not found
    06:37:09 web.1  | exited with code 2
    06:37:09 system | sending SIGTERM to all processes
    SIGTERM received
    

Also I have installed specific version of foreman (0.60.2) which shows the same error as above when started.

The .profile file is found in the following locations in my machine:

    /home/user/.profile
    /etc/skel/.profile
    /root/.profile

which contains: # ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

mesg n

Could this be because of wrong path settings? What is preventing foreman from starting?

  • Ramesh
1

1 Answers

1
votes

I'm getting a similar error but with slightly more detail:

21:16:46 bridge.1 | /var/lib/gems/1.9.1/gems/foreman-0.61.0/bin/foreman-runner: 37: .: .profile: not found

So I've had a look at the foreman-runner and it looks like it's trying to load a .profile file from the current directory. Although I'm running foreman from a directory where I have a .profile and it's still not finding it.

It would seem that foreman-runner is being called with a -p parameter. Then it tests for the existence of a .profile file and only then does it try to source it. So it checks the file but can't source it. The line that actually does the source is as follows:

. .profile

This file starts #!/bin/sh so I ran /bin/sh and tried . .profile from the command line and sure enough it complains the .profile is not found, huh?! Actually what it says is:

/bin/sh: 4: .: .profile: not found

What is that 4 doing there? Maybe it just doesn't like something in my .profile.

So I moved my .profile to profile.bak and viola, foreman now runs.