Rails 3.1 Sqlite3 推送到 Heroku 时出错

发布于 2024-12-11 15:00:51 字数 1013 浏览 0 评论 0原文

我有一个 Rails 3.1 应用程序,我正在尝试将其推送到 Heroku。当我推动它时它总是失败。

Installing sqlite3 (1.3.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
       /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
       /usr/local/bin/ruby extconf.rb
       checking for sqlite3.h... no
       sqlite3.h is missing. Try 'port install sqlite3 +universal'
       or 'yum install sqlite3-devel' and check your shared library search path (the
       location where your sqlite3 shared library is located).

我将 gem 文件更改为包含以下几行:

gem 'sqlite3', :group => [:development, :test]
gem 'pg', :group => [:production]

即使在运行捆绑安装等之后,我也会收到错误。我什至在 gem 文件中没有 sqlite3 的情况下运行了一些测试,但它仍然尝试在 Heroku 上安装它。有什么建议吗?

I have a rails 3.1 app that i am trying to push to Heroku. It keeps failing when i push it.

Installing sqlite3 (1.3.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
       /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
       /usr/local/bin/ruby extconf.rb
       checking for sqlite3.h... no
       sqlite3.h is missing. Try 'port install sqlite3 +universal'
       or 'yum install sqlite3-devel' and check your shared library search path (the
       location where your sqlite3 shared library is located).

I changed my gem file to have the following lines:

gem 'sqlite3', :group => [:development, :test]
gem 'pg', :group => [:production]

Even after running bundle install etc i am getting the error. I even ran some tests without sqlite3 in my gem file and it still tries to install it on Heroku. Any suggestions?

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

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

发布评论

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

评论(2

阳光下的泡沫是彩色的 2024-12-18 15:00:51

哈哈,原来我正在一个分支上工作,并且正在推动我的主人。一旦我合并它们并推送正确的分支,一切就都很好。

Lol it turns out i was working on one branch and was pushing my master. Once i merged them and pushed the correct branch everything worked great.

半仙 2024-12-18 15:00:51

根据文档,Cedar 堆栈尚不支持 bundle withouthttp:// /devcenter.heroku.com/articles/bundler 因此它仍会尝试在部署时安装它。

老实说,如果您也正在部署 postgres,那么您在本地使用 postgres 会更好。

The Cedar stack doesn't yet support bundle without according to the docs, http://devcenter.heroku.com/articles/bundler so it will still attempt to install it on deployment.

To be honest, you'd be much better using postgres locally if that is what you're deploying too.

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