Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
401 views
in Technique[技术] by (71.8m points)

node.js - Heroku wrongly detecting my Node app as a Ruby app

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...