Heroku 错误地将我的 Node 应用程序检测为 Ruby 应用程序 [英] Heroku wrongly detecting my Node app as a Ruby app

查看:24
本文介绍了Heroku 错误地将我的 Node 应用程序检测为 Ruby 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Node 项目,它使用 Bundler 和 Guard 来处理我的预编译步骤.这意味着我的项目根目录中有一个 Gemfile 以及 package.json 文件.

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.

我的问题是 Heroku 认为我的项目是一个 Ruby 应用程序,仅仅因为 Gemfile 存在.并抱怨我没有提交 Gemfile.lock,我不想提交.

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

有没有办法告诉 Heroku 该应用程序是 Node 应用程序而不是 Ruby 应用程序?

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

推荐答案

似乎有一种新方法可以做到这一点,因为 BUILDACK_URL 现在已被弃用,解释了 这里,但基本上命令是:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆