Rails 3.2:Heroku 推送被拒绝,未检测到 Cedar 支持的应用程序

发布于 2025-01-06 01:38:55 字数 283 浏览 5 评论 0原文

这里是 Rails 新手。我正在尝试将 Rails 3.1/Ruby 1.9.3-p0 应用程序部署到 Heroku,并按照 Heroku 执行了所有步骤。但我不断遇到:

Heroku 推送被拒绝,未检测到 Cedar 支持的应用程序

我已经尝试了 这个问题但到目前为止还没有成功。

Rails newbie here. I'm trying to deploy my Rails 3.1/Ruby 1.9.3-p0 app to Heroku and have followed all the steps according to Heroku. But I keep running into:

Heroku push rejected, no Cedar-supported app detected

I've tried all the suggestions in this question but so far unsuccessful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

纸短情长 2025-01-13 01:38:55

我也遇到过类似的拒绝。对我有用的是重新初始化 .git 文件。

在命令行中尝试:

rm -rf .git
git init
git add .
git commit -am "Reinitialize"
heroku create --stack cedar
git push heroku master

I have encountered a similar rejection. What worked for me was reinitializing the .git file.

Try in the command line:

rm -rf .git
git init
git add .
git commit -am "Reinitialize"
heroku create --stack cedar
git push heroku master
瞄了个咪的 2025-01-13 01:38:55

我刚刚用我的一个应用程序解决了这个问题。如果您查看文档,Cedar Stack会在根目录中搜索Gemfile 。就我而言,根目录只有包含我的应用程序的文件夹,其中包含 Gemfile。

因此,您需要做的是在该文件夹中初始化一个新的 git 存储库并添加远程:

$ cd my_app_folder
$ git init
$ git add .
$ git commit -m "Heroku commit"
$ git remote add heroku [email protected]:my-app-in-heroku.git
$ git push heroku master

然后您就完成了!

I Have just solved this problem with one of my apps. If you check the documentation, the Cedar Stack searches for the Gemfile in the root directory. In my case, the root directory only had the folder containing my app with the Gemfile inside it.

So, what you need to do is to initialize a new git repo inside this folder and add the remote:

$ cd my_app_folder
$ git init
$ git add .
$ git commit -m "Heroku commit"
$ git remote add heroku [email protected]:my-app-in-heroku.git
$ git push heroku master

And you're done!

南渊 2025-01-13 01:38:55

每当遇到此错误时,我都会检查以下两件事:

  • 确保 Gemfile 存在于 Rails 应用程序的根目录中。 Heroku 使用它来确定要部署的应用程序类型。
  • 确保 Rails 应用程序根目录本身置于版本控制之下(例如:Git)而不是其父目录。

如果您不小心将 Rails 应用程序的父目录置于版本控制中。删除此父目录中的 .git 目录并初始化一个新的存储库,但这次是在 Rails 应用程序目录下。

Whenever I encounter this error, I check the following two things:

  • Make sure the Gemfile exist in root directory of Rails application. Heroku use it to determine what type of application to deploy.
  • Make sure the Rails app root directory itself is put under version control (e.g: Git) rather than its parent directory.

If you accidentally put the parent directory of your rails application into version control. Delete the .git directory inside this parent directory and initialize a new repository but this time under the Rails application directory.

箹锭⒈辈孓 2025-01-13 01:38:55

尝试

$ git init
$ git add .
$ git commit -m "Change to something"

然后运行

git push heroku master

Try

$ git init
$ git add .
$ git commit -m "Change to something"

Then run

git push heroku master
岁月染过的梦 2025-01-13 01:38:55

我之前遇到过这个问题几次,那是因为我试图将远程分支推送到heroku。

为了解决这个问题,而不是使用:

git push heroku master

我使用:

git push heroku my-branch:master

这会将 git 存储库中的远程分支 my-branch 推送到 heroku 的 master 分支。

I have encountered this issue a few time before and it was because I was trying to push a remote branch to heroku.

To solve the problem, instead of using:

git push heroku master

I used:

git push heroku my-branch:master

This pushes the remote branch my-branch in the git repository to the master branch of heroku.

旧城空念 2025-01-13 01:38:55

我有同样的问题。我的文件结构不是heroku 所期望的(.git 必须与 Gemfile 处于同一级别)。我删除了 Rails_Code 文件夹并且它起作用了。

Project\
         .git
         Rails_Code\
                     Gemfile
                     etc...

I have the same problem. My file structure was not what heroku expected (.git must be on the same level as Gemfile). I removed the Rails_Code folder and it worked.

Project\
         .git
         Rails_Code\
                     Gemfile
                     etc...
你好,陌生人 2025-01-13 01:38:55

同样的情况,就像 @petwho 上面所说的

“确保 Gemfile 存在于 Rails 应用程序的根目录中。Heroku 使用它来确定要部署的应用程序类型。”

就我而言,不知何故,我的 GemfilesGemfile.lock 被忽略了。当我在 github 上检查时,我的应用程序没有推送 Gemfile,因为 .gitignore 忽略了我的 gemfile。

从 gitignore 中删除我的 gemfiles 后,我推送到 heroku ,一切都很顺利

Same Situation, Like @petwho said above

"Make sure the Gemfile exist in root directory of Rails application. Heroku use it to determine what type of application to deploy."

In my case, somehow my Gemfiles and Gemfile.lock was being ignored. When I checked on github there was no Gemfile being pushed up with my app due because .gitignore was ignoring my gemfiles.

After removing my gemfiles from gitignore, I pushed to heroku and everything worked smoothly

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文