Question

I am trying to run foreman on a Mint VM i just setup. It is for the purpose of learning node. I am using Heroku and their guide to get myself setup but i have hit a road block when i try and start foreman.

The error message is:

14:51:09 web.1  | started with pid 10739
14:51:09 web.1  | exited with code 1
14:51:09 system | sending SIGTERM to all processes
SIGTERM received

Any help would be great!

Was it helpful?

Solution

If you are following a guide specifically for use on a Heroku instance then it will skip some steps that will be required for setting up on other boxes. By default heroku instances have node.js installed, so there is no need to get this set up on the box prior to deploying and launching your first application.

To install Node.js on Linux Mint. Do the following:

  1. Install required tools

    sudo apt-get install g++ curl libssl-dev apache2-utils

    sudo apt-get install git-core

  2. Clone and make latest version of Node.js

    git clone git://github.com/ry/node.git

    cd node

    ./configure

    make

    sudo make install

  3. Go to your working directory for this project and run the following:

    npm install

    foreman start

Your Node.js application example should now be working on your local VM.

To get a sample node app for testing your local setup do the following:

`git clone git@github.com:heroku/node-js-sample.git # or clone your own fork`

`cd node-js-sample`

`npm install`

`foreman start`

Browse to http://localhost:5000 to see the sample application.

OTHER TIPS

I know it's been a while but since none of the above answers worked for me I thought I'd post what I did to get Heroku foreman to work with Express 4 (took me ages to figure out!)

In your app.js (or whatever your entry file is):

Add this line the app.use(express.static(path.join....

app.set('port', (process.env.PORT || 5000));

Add this line to the end of your file:

app.listen(app.get('port'), function() {
  console.log("Node app is running at localhost:" + app.get('port'))
});

If you were using the express-generator, remove this line:

module.exports = app;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top