Heroku 使用 Ruby Mongrel gem 时出现错误
在相关帖子中找不到我的错误的答案。
我正在学习 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您根本不需要使用 mongrel,只需将其从
Gemfile
中删除即可。每当您在教程中看到启动 mongrel 的引用时,只需使用./script/server
即可(如果您使用的是 Rails 3,则使用rails server
)。它将运行 WebBrick,这对于开发工作来说已经足够了。如果您确实想保留 mongrel 供本地使用,您可以在
Gemfile
中将其分组如下。请注意,您可能仍然需要告诉 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 (orrails 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
.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.