jim_vx
jim_vx

Reputation: 1653

Why do gems with native extensions fail to build on Ubuntu?

I can run bundle install on my Mac without a problem, but when I run it on my Ubuntu build server it fails with the following output:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/var/lib/jenkins/.rvm/rubies/ruby-1.9.3-p385-dev/bin/ruby extconf.rb 
creating Makefile

make
compiling native.c
native.c: In function ‘birch_edge_initialize’:
native.c:42:8: warning: unused variable ‘direction’ [-Wunused-variable]
native.c:41:8: warning: unused variable ‘directed’ [-Wunused-variable]
native.c:40:8: warning: unused variable ‘node_b’ [-Wunused-variable]
native.c:39:8: warning: unused variable ‘node_a’ [-Wunused-variable]
native.c:58:1: warning: control reaches end of non-void function [-Wreturn-type]
linking shared-object birch/native.so

make install
/usr/bin/install -c -m 0755 native.so /var/lib/jenkins/jobs
/usr/bin/install -c -m 0755 native.so .
/usr/bin/install: 'native.so' and './native.so' are the same file
make: *** [-] Error 1

I'm using RVM, ruby version ruby-1.9.3-p385-dev.

The problem isn't specific to one gem either - removing birch results in the same type of error for bson with native extensions.

Upvotes: 1

Views: 361

Answers (1)

jim_vx
jim_vx

Reputation: 1653

It seems this was caused by a bad RVM install. I initially installed rvm using apt (bad, bad idea), and it looks like the purge didn't clean everything up. Setting up a clean ec2 instance with a clean rvm install fixed it

Upvotes: 1

Related Questions