This project is archived and is in readonly mode.
Vendorised gems (e.g. rspec-rails) not recognised as being installed
Reported by Chris Roos | May 20th, 2009 @ 03:08 PM | in 2.x
I've got rspec and rspec-rails unpacked in vendor/gems and the dependencies defined in environments/test.rb (as specified here[1]). I checked out my project to a machine that doesn't have gems installed and tried to run the rake test tasks. The result was a warning that rspec-rails wasn't installed.
$ rake spec
...
Missing these required gems:
rspec-rails = 1.2.0
It took a while but I managed to work that this was because rspec-rails depends upon rack and rack wasn't installed. It took so long because the Gem::LoadError exception (raised because rack was missing) is swallowed within Rails::GemDependency#add_load_paths.
The attached patch amends an existing test that exposes this behaviour and implements a very lightweight fix in the form of a warning. With the patch applied, the output looks something like this.
$ rake spec
*** WARNING: Missing dependency 'rack' (>= 0.4.0) required by 'rspec-rails'
Missing these required gems:
rspec-rails = 1.2.0
[1] http://wiki.github.com/dchelimsky/rspec/configgem-for-rails
Comments and changes to this ticket
-
Tom Ward May 20th, 2009 @ 03:14 PM
I've encountered this issue too. Giving a warning is the least I'd expect. The patch looks good to me, so +1.
-
James Mead May 20th, 2009 @ 03:25 PM
Swallowing exceptions is nasty. The patch looks good. +1 from me.
-
Chris Roos May 20th, 2009 @ 03:36 PM
- Tag changed from gem, gem_dependency, rspec_rails to gem, gem_dependency, rspec_rails, verified
-
Matt Jones June 6th, 2009 @ 11:32 PM
- Good catch - this bit of Rails is somewhat notorious for unhelpful error messages.
-
Felipe Rodrigues July 16th, 2009 @ 04:42 PM
I have a similar case where the patch didn't work as expected.
-
Rizwan Reza January 25th, 2010 @ 12:49 AM
- State changed from new to invalid
This isn't applicable anymore, as Rails now uses Bundler. If you think it's a bug that should be addressed in 2-3-stable, let me know and I'll have someone apply it. Thanks.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2913 config.gem causes error in some gems I'd recommend you take a look at ticket #2682, which may ...