Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top