More 1.9.3 fun

Michael Stahnke mastahnke at gmail.com
Thu Jan 19 00:26:47 UTC 2012


When installing a gem natively using ruby 1.9.3 package built from the
github ruby.spec, I'm having trouble using them, specifically with
bundler.

When I install sqlite3, I get a shared object in

[root at centos6-32 gems]# locate sqlite3_native.so
/usr/local/lib/gems/exts/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.so
/usr/local/share/gems/gems/sqlite3-1.3.5/ext/sqlite3/sqlite3_native.so

It seems odd that the lib dir and the gems dir are not the same.  That
may not be the issue though.

When I install via bundler (forgive my ignorance here, I normally
avoid bundler, but for this application it was required).

bundle install  --without development test


[root at centos6-32 gitlabhq]# bundle show sqlite3
/usr/local/share/gems/gems/sqlite3-1.3.4
[root at centos6-32 gitlabhq]# bundle exec rake -T
rake aborted!
cannot load such file -- sqlite3/sqlite3_native

(See full trace by running task with --trace)
[root at centos6-32 gitlabhq]# bundle exec rake -T --trace
rake aborted!
cannot load such file -- sqlite3/sqlite3_native
/usr/local/share/gems/gems/sqlite3-1.3.4/lib/sqlite3.rb:6:in `require'
/usr/local/share/gems/gems/sqlite3-1.3.4/lib/sqlite3.rb:6:in `rescue
in <top (required)>'
/usr/local/share/gems/gems/sqlite3-1.3.4/lib/sqlite3.rb:2:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
/usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in
`block (2 levels) in require'
/usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
/usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in
`block in require'
/usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
/usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
/usr/local/share/gems/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
/srv/gitlabhq/config/application.rb:7:in `<top (required)>'
/srv/gitlabhq/Rakefile:5:in `require'
/srv/gitlabhq/Rakefile:5:in `<top (required)>'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/application.rb:501:in
`raw_load_rakefile'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block
in load_rakefile'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling'
/usr/share/gems/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/bin/rake:32:in `<main>'


[root at centos6-32 gitlabhq]# bundle console
/usr/local/share/gems/gems/sqlite3-1.3.4/lib/sqlite3.rb:6:in
`require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
	from /usr/local/share/gems/gems/sqlite3-1.3.4/lib/sqlite3.rb:6:in
`rescue in <top (required)>'
	from /usr/local/share/gems/gems/sqlite3-1.3.4/lib/sqlite3.rb:2:in
`<top (required)>'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in
`require'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in
`block (2 levels) in require'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in
`each'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in
`block in require'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in
`each'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in
`require'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/cli.rb:430:in
`console'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/vendor/thor/task.rb:22:in
`run'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/vendor/thor/invocation.rb:118:in
`invoke_task'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/vendor/thor.rb:263:in
`dispatch'
	from /usr/local/share/gems/gems/bundler-1.0.21/lib/bundler/vendor/thor/base.rb:386:in
`start'
	from /usr/local/share/gems/gems/bundler-1.0.21/bin/bundle:13:in `<top
(required)>'
	from /usr/local/bin/bundle:19:in `load'
	from /usr/local/bin/bundle:19:in `<main>'


So, obviously the bundle can't find the C extension.  According to
some research, I see this on rubygems.org

"This works because rubygems copies the shared object from ext to lib
when the gem is installed."

I'm not sure that's happening.


I may be completely wrong with that I am doing here as well. The new
layout of gems in the 1.9 paradigm is still a bit confusing to me, so
that's why I am suspecting it is the issue. It potentially could be
the application (http://gitlabhq.com) as well.

Any help would be welcome.


More information about the ruby-sig mailing list