Heroku错误地将我的Node应用程序检测为Ruby应用程序 [英] Heroku wrongly detecting my Node app as a Ruby app
问题描述
我有一个使用Bundler和Guard处理我的预编译步骤的Node项目。
这意味着我的项目根目录中有一个Gemfile以及package.json文件。
我的问题是Heroku相信我的项目是一个Ruby应用程序,只是因为Gemfile存在。并抱怨说我没有提交Gemfile.lock,我不想提交它。
----- > Heroku接收推送
-----> Ruby应用程序检测到
!
! Gemfile.lock是必需的。请在本地运行捆绑安装
!并提交你的Gemfile.lock。
!
! Heroku推送被拒绝,未能编译Ruby应用程序
有没有办法告诉Heroku该应用程序是节点应用程序,而不是一个Ruby应用程序?
看起来有一种新的方式来做到这一点 BUILDPACK_URL
现已弃用,请参阅此处,但基本上这个命令是:
$ heroku buildpacks:set heroku / nodejs
您也可以在创建应用程序时指定一个buildpack:
$ heroku create myapp --buildpack heroku / nodejs
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?
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
这篇关于Heroku错误地将我的Node应用程序检测为Ruby应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!