Bundler ignores :group => :production?

I’m using SQLite on my dev box and MySQL in production. I’m also
running an old mysql adapter gem in production that worked around
problems with the MySQL adapter and Ruby 1.9.1. That gem was hosted on
github and hasn’t been moved anywhere, so it’s only available locally
on my production machine.

No problem, I think, I’ll just set up my Gemfile with:

group :production do
gem “hectoregm-mysql-ruby”, “2.8.1”
end

Works fine in production, but back in development, I get this error:

/usr/local/lib/ruby/gems/1.9.1/gems/bundler-0.9.3/lib/bundler/
resolver.rb:163:in `resolve’: Could not find gem ‘hectoregm-mysql-ruby
(>= 0, runtime)’ in any of the sources. (Bundler::GemNotFound)

Doesn’t shock me that Bundler can’t find this gem, but why is it
looking for it? I’m in development.

I realize there are a dozen ways to work around this, but I’m more
interested in understanding what specifying an environment in Bundler
does. My first guess was that it should, say, specify which gems are
required in which environment, which would mean the absence of a gem
required only in production would not throw an exception when you try
to launch your app in development. But now it looks like I’m wrong. Or
am I just doing something wrong?

At my dev box it doesn’t listen to the group parameter either. Just to
let
you know that it isn’t just your box – maybe something in Rails 3?

2010/2/13 Steve R. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs