12

I have a Node project that is using Bundler and Guard to handle my pre-compilations steps. This means that I have a Gemfile in the root of my project along with the package.json file.

My problem is that Heroku believes that my project is a Ruby app, just because the Gemfile exists. And complains that I have not committed the Gemfile.lock, which I don't want to commit.

-----> Heroku receiving push
-----> Ruby app detected
 !
 !     Gemfile.lock is required. Please run "bundle install" locally
 !     and commit your Gemfile.lock.
 !
 !     Heroku push rejected, failed to compile Ruby app

Is there a way to tell Heroku that the app is a Node app and not a Ruby app?

2
  • 3
    I think you should ask the heroku support. Commented Apr 4, 2012 at 9:19
  • I suppose, I should have done that directly. I thought I would get a faster answer here, though :) Commented Apr 4, 2012 at 12:41

2 Answers 2

34

The solution to this, with a lot of help from Heroku Support is: use a build pack!

Override the Heroku default buildpacks by specifying a custom buildpack in the BUILDPACK_URL config var

$ heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs

You can also specify a buildpack during app creation

$ heroku create -s cedar --buildpack https://github.com/heroku/heroku-buildpack-nodejs

Simple when you know it. Some more documentation can be found at Heroku Dev Center

Sign up to request clarification or add additional context in comments.

1 Comment

At the Heroku Dev Center link that andersjanmyr noted, they have the buildpacks in a certain order in a table, and they say: "By default, these buildpacks will be searched in this order until a match is detected and used to compile your app."
4

It seems there's a new way to do this as BUILDPACK_URL is now deprecated, explained here, but essentially the command is:

$ heroku buildpacks:set heroku/nodejs

You may also specify a buildpack during app creation:

$ heroku create myapp --buildpack heroku/nodejs

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.