将 Rails 应用程序推送到 heroku 不起作用

发布于 2024-10-06 15:03:17 字数 902 浏览 1 评论 0原文

我正在尝试使用 git Push heroku master 将我的 Rails 3 应用程序上传到 Heroku,但我不断收到以下错误:

-----> Heroku receiving push
-----> Removing .DS_Store files
-----> Rails app detected
!     Heroku Bamboo does not include any Rails gems by default.
!     You'll need to declare it in either .gems or Gemfile.
!     See http://docs.heroku.com/gems for details on specifying gems.
!     Heroku push rejected, no Rails gem specified.

error: hooks/pre-receive exited with error code 1

我尝试删除 Heroku 网站上的 并重新开始,我也尝试清除我的 git repo 并再次执行 init,但我不断收到相同的错误。我的 Gemfile 如下:

source :rubygems 

gem 'rails', '3.0.3'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'devise', '1.1.3'
gem 'acts-as-taggable-on'
gem 'ruby-debug'
# for sass
gem 'haml'
gem 'mocha'
gem 'ruby-pg'

我已经运行捆绑包将宝石打包到供应商缓存中,但它似乎没有改变结果。

我从 Rails 2.3 升级了这个应用程序,所以我想知道这是否与它有什么关系?

I'm trying to use git push heroku master to upload my rails 3 app to heroku, but I keep getting the following error:

-----> Heroku receiving push
-----> Removing .DS_Store files
-----> Rails app detected
!     Heroku Bamboo does not include any Rails gems by default.
!     You'll need to declare it in either .gems or Gemfile.
!     See http://docs.heroku.com/gems for details on specifying gems.
!     Heroku push rejected, no Rails gem specified.

error: hooks/pre-receive exited with error code 1

I've tried deleting the on the heroku website and starting again, i've also tried wiping out my git repo and doing init again, and I keep getting the same error. My Gemfile is as follows:

source :rubygems 

gem 'rails', '3.0.3'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'devise', '1.1.3'
gem 'acts-as-taggable-on'
gem 'ruby-debug'
# for sass
gem 'haml'
gem 'mocha'
gem 'ruby-pg'

I've run bundle package to package teh gems into vendor cache, but it doesn't seem to change the result.

I upgraded this app from rails 2.3, so i'm wondering if that has anything to do with it?

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

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

发布评论

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

评论(2

千里故人稀 2024-10-13 15:03:17

这是我从 Heroku 得到的答案:

嗨,

问题似乎是你的 Gemfile 被称为 GemFile。虽然这适用于 Mac 等某些平台,但不适用于严格区分大小写的文件系统,例如我们的系统。

为了在 HFS 或 NTFS 等保留大小写、不区分大小写的文件系统中重命名文件,您需要分两步进行:

git mv GemFile Gemfile.temp
git mv Gemfile.temp Gemfile

This is the answer I got from Heroku:

Hi,

The problem seems to be that your Gemfile is called GemFile. While that'll work on some platforms like the Mac, that won't work on a strictly case-sensitive filesystem, such as ours.

In order to rename the file in a case-retaining, case-insensitive file system like HFS or NTFS, you'll need to do it in two steps:

git mv GemFile Gemfile.temp
git mv Gemfile.temp Gemfile
天荒地未老 2024-10-13 15:03:17

尝试将这些添加到您的 Gemfile

gem 'pg' # Heroku's DB runs on postgresql
gem 'heroku'

Try adding these to your Gemfile

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