Re: config.gem/rspec-rails/rspec bug (#577)


#1

Hey all,

Just a heads up about a bug related to configuring the rspec gems in
your rails 2.1.1 projects:

http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/577

Apparently, if you config.gem both rspec and rspec-rails 1.1.9 w/
rspec first, you’ll get an error:

DON’T DO THIS:

config.gem ‘rspec’, :lib => ‘spec’, :version => ‘1.1.9’
config.gem ‘rspec-rails’, :lib => ‘spec/rails’, :version => ‘1.1.9’

The workaround is to either reverse these lines:

OK

config.gem ‘rspec-rails’, :lib => ‘spec/rails’, :version => ‘1.1.9’
config.gem ‘rspec’, :lib => ‘spec’, :version => ‘1.1.9’

or just require rspec-rails if you’re using rubygems >= 1.2 (since
installing rspec-rails will, by default, install rspec)

OK

config.gem ‘rspec-rails’, :lib => ‘spec/rails’, :version => ‘1.1.9’

Keep your eye on the ticket
(http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/577) to
see when this is resolved.

Cheers,
David


#2

On 21 Oct 2008, at 19:51, David C. wrote:

Hey all,

Just a heads up about a bug related to configuring the rspec gems in
your rails 2.1.1 projects:

I had a little crack at this, but I got scared off as there seems to
be some chicken-and-egg stuff going on. My rake tasks require rspec,
but if rspec gem isn’t installed yet, the rake environment won’t load
and I can’t run rake gems:install.

Am I doing something dumb?


#3

On Wed, Oct 22, 2008 at 4:48 AM, Matt W. removed_email_address@domain.invalid wrote:

rake gems:install.

Am I doing something dumb?

Did you updated the generate rake tasks?

Since you’re using the gem based one, require ‘rubygems’ before
require ‘spec’ should work.

I was bitten several time by RubyGems dependencies that I just try to
avoid them, the more explicit you are, the better :smiley:


Luis L.
AREA 17

Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams


#4

On 22 Oct 2008, at 10:58, Luis L. wrote:

to be some
chicken-and-egg stuff going on. My rake tasks require rspec, but if
rspec
gem isn’t installed yet, the rake environment won’t load and I
can’t run
rake gems:install.

Am I doing something dumb?

Did you updated the generate rake tasks?

As in script/generate rspec? I think so. Is there some update to the
file dropped into lib/tasks/rspec.rake that fixes this?

Since you’re using the gem based one, require ‘rubygems’ before
require ‘spec’ should work.

But if I’m on a machine that doesn’t have the gems installed (e.g. the
production server)…? What then? We have the gem frozen into vendor
gems, but that doesn’t seem to be enough…