From: "drbrain (Eric Hodel)" Date: 2013-11-16T06:37:51+09:00 Subject: [ruby-core:58370] [ruby-trunk - Bug #9106] 'gem install' doesn't copy .so files of ext libs Issue #9106 has been updated by drbrain (Eric Hodel). =begin @frsyuki: you should trust rubygems to make msgpack/msgpack.so accessible somewhere in the $LOAD_PATH so: require 'msgpack/msgpack' so option c is the best fix. With RubyGems 2.2 the directory you `gem install` to can be shared across multiple ruby versions because the extensions end up in $GEM_HOME/extensions///. RubyGems will add that directory to $LOAD_PATH so require can find files in it. For msgpack, on OS X with ruby 2.1.0 this would be: $GEM_HOME/extensions/x86_64-darwin-12/2.0.0/msgpack-0.5.7/msgpack/msgpack.bundle I will figure out a backward compatible solution so older msgpack will still work for RubyGems 2.x. There is no reason for you to rush out a new release of msgpack. =end ---------------------------------------- Bug #9106: 'gem install' doesn't copy .so files of ext libs https://bugs.ruby-lang.org/issues/9106#change-42969 Author: tagomoris (Satoshi TAGOMORI) Status: Assigned Priority: Normal Assignee: drbrain (Eric Hodel) Category: Target version: current: 2.1.0 ruby -v: ruby 2.1.0dev (2013-11-12 trunk 43653) [x86_64-linux] Backport: 1.9.3: DONTNEED, 2.0.0: DONTNEED 'gem install' should copy files of 'ext/**/*.so' of each installed gems, but doesn't. $ ruby -v ruby 2.1.0dev (2013-11-12 trunk 43653) [x86_64-linux] $ gem install msgpack Fetching: msgpack-0.5.7.gem (100%) Building native extensions. This could take a while... Successfully installed msgpack-0.5.7 [] Parsing documentation for msgpack-0.5.7 Installing ri documentation for msgpack-0.5.7 Done installing documentation for msgpack after 0 seconds 1 gem installed $ ruby -rmsgpack -e '' /home/user/local/ruby-2.1.0-trunk/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- /home/user/local/ruby-2.1.0-trunk/lib/ruby/gems/2.1.0/gems/msgpack-0.5.7/lib/msgpack/msgpack (LoadError) from /home/user/local/ruby-2.1.0-trunk/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /home/user/local/ruby-2.1.0-trunk/lib/ruby/gems/2.1.0/gems/msgpack-0.5.7/lib/msgpack.rb:8:in `rescue in ' from /home/user/local/ruby-2.1.0-trunk/lib/ruby/gems/2.1.0/gems/msgpack-0.5.7/lib/msgpack.rb:3:in `' from /home/user/local/ruby-2.1.0-trunk/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require' from /home/user/local/ruby-2.1.0-trunk/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require' from /home/user/local/ruby-2.1.0-trunk/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require' $ ls -l local/ruby-2.1.0-trunk/lib/ruby/gems/2.1.0/gems/msgpack-0.5.7/lib/msgpack total 4 -rw-r--r-- 1 edge-dev edge 42 Nov 13 15:43 version.rb $ ls -l local/ruby-2.1.0-trunk/lib/ruby/gems/2.1.0/gems/msgpack-0.5.7/ext/msgpack/msgpack.so -rwxr-xr-x 1 edge-dev edge 1390955 Nov 13 15:43 local/ruby-2.1.0-trunk/lib/ruby/gems/2.1.0/gems/msgpack-0.5.7/ext/msgpack/msgpack.so -- http://bugs.ruby-lang.org/