Heroku 使用 Ruby Mongrel gem 时出现错误

发布于 2024-12-17 01:46:04 字数 764 浏览 1 评论 0原文

在相关帖子中找不到我的错误的答案。

我正在学习 Ruby on Rails 教程的在线版本,第 2 章 http://ruby.railstutorial.org/chapters/a-demo-app#top

我在底部附近创建了一个小型 2 表数据库并将其提交给 git。但当我尝试使用“git push heroku master”进行部署时,它失败了。在我将表添加到应用程序之前(我认为在我让 Mongrel 处理 demo_app 之前),相同的命令之前也有效。

我的捆绑包包括 Ruby 1.8.7、Mongrel 1.1.5 和 sqlite3 1.3.3。我收到这样的消息:

Installing mongrel (1.1.5) with native extensions /usr/ruby1.9.2/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).

我该如何解决这个问题? Heroku 能对付 Mongrel 吗?或者是因为有sqlite3数据库?当我的包中没有 Ruby1.9.2 时,为什么错误会提到 Ruby1.9.2?

Can't quite find the answer for my error in related posts.

I'm working my way through the on-line version of the Ruby on Rails Tutorial, Chapter 2
http://ruby.railstutorial.org/chapters/a-demo-app#top

and I'm near the bottom where I've created a small 2-table database and committed it to git. But it fails when I try to deploy with 'git push heroku master'. The same command worked previously before I added the tables to the app (and before I got Mongrel to work on the demo_app, I think).

My bundle includes Ruby 1.8.7, Mongrel 1.1.5 and sqlite3 1.3.3. I'm getting the line:

Installing mongrel (1.1.5) with native extensions /usr/ruby1.9.2/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).

How do I get around this problem? Can Heroku handle Mongrel at all? Or is it due to having a sqlite3 database? Why does the error mention Ruby1.9.2 when that's not in my bundle?

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

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

发布评论

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

评论(1

暗藏城府 2024-12-24 01:46:04

您根本不需要使用 mongrel,只需将其从 Gemfile 中删除即可。每当您在教程中看到启动 mongrel 的引用时,只需使用 ./script/server 即可(如果您使用的是 Rails 3,则使用 rails server)。它将运行 WebBrick,这对于开发工作来说已经足够了。

如果您确实想保留 mongrel 供本地使用,您可以在 Gemfile 中将其分组如下。

group :development do
  gem "mongrel"
end

请注意,您可能仍然需要告诉 Heroku 不要捆绑您的开发 gem,否则您'会遇到同样的错误。如果你在雪松堆上,那么就完全摆脱杂种宝石。

You don't need to use mongrel at all, and should simply remove it from your Gemfile. Whenever you see a reference to starting mongrel in your tutorial, just use ./script/server instead (or rails server if you're on Rails 3). It will run WebBrick, and that's good enough for development work.

If you really want to retain mongrel for local use you can group it as follows in Gemfile.

group :development do
  gem "mongrel"
end

Note that you will likely still have to tell Heroku to not bundle your development gems or you'll run into the same error. If you're on the Cedar stack, then just get rid of the mongrel gem entirely.

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