Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 313279

Summary: Bundler needs dependency info in installed gemspecs
Product: Gentoo Linux Reporter: Petteri Räty (RETIRED) <betelgeuse>
Component: [OLD] DevelopmentAssignee: Gentoo Ruby Team <ruby>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://github.com/carlhuda/bundler/issues/issue/251
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 304165    
Bug Blocks: 335247    

Description Petteri Räty (RETIRED) gentoo-dev 2010-04-05 17:58:49 UTC
http://github.com/carlhuda/bundler/issues/issue/251

People probably expect bundler to work with Gentoo installed gems so we should record dependency information to our gemspecs or package a patched and recent bundler (bug 313261) that gets the info elsewhere.
Comment 1 Hans de Graaff gentoo-dev Security 2010-10-16 08:31:24 UTC
I've just added bundler 1.0.3 to the tree, and as far as I know it takes a different approach to bundling things, so I'm wondering if this problem is still valid with bundler 1.0.3. Could you test it?
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2010-11-21 18:40:07 UTC
It appears to be working. It seems bundler downloads the .gem files if they don't exist. I tested with all ruby nuked and got:

betelgeuse@pena ~/test/gentoo-bundler $ bundle
/usr/lib/ruby/1.8/fileutils.rb:243:in `mkdir': Permission denied - /usr/local/lib/ruby/gems (Errno::EACCES)

then went on to create:

mkdir -p /usr/local/lib/ruby/gems/1.8

betelgeuse@pena ~/test/gentoo-bundler $ bundle
Fetching source index for http://rubygems.org/
Enter your password to install the bundled RubyGems to your system: 
Using rake (0.8.7) 
Using bundler (1.0.3) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
betelgeuse@pena ~/test/gentoo-bundler $ bundle show rake
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7

betelgeuse@pena ~/test/gentoo-bundler $ qfile /usr/lib/ruby/gems/1.8/gems/rake-0.8.7
dev-ruby/rake (/usr/lib/ruby/gems/1.8/gems/rake-0.8.7)
Comment 3 Hans de Graaff gentoo-dev Security 2010-12-05 09:24:44 UTC
I'm reopening this because bundler still expects dependency info in the .gemspec, at least with 1.0.7. This is evident in Rails 3, which won't work out of the box:

$ script/rails
script/rails:6:in `require': no such file to load -- rails/commands (LoadError)
	from script/rails:6

This happens because the default Gemfile that is created as part of a new project only refers to the 'rails' gem, and bundler in turn only adds the referenced gem and its dependencies to the search path. Since in our case the rails gemspec doesn't contain dependencies, the other rails components are not added to the search path.
Comment 4 Hans de Graaff gentoo-dev Security 2010-12-28 12:14:42 UTC
This is fixed in revision 1.27 of ruby-fakegem.eclass, which now tries to install the upstream gemspec file if possible, either by using the metadata distributed with the gem or by using the source gemspec file. We only install our own version as a fallback now.

Note that this may require additional changes to packages, and that only packages installed after ruby-fakegem 1.27 get this gemspec. If you run into issues: reinstall the package in question or file a bug for it.