Skip to content

Instantly share code, notes, and snippets.

@owenthereal
Created February 23, 2012 14:57
Show Gist options
  • Save owenthereal/1893182 to your computer and use it in GitHub Desktop.
Save owenthereal/1893182 to your computer and use it in GitHub Desktop.
error when installing posix-spawn gem with JRuby 1.6.7
Installing posix-spawn (0.3.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/Owen/.rvm/rubies/jruby-1.6.7/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very well.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
creating Makefile
make
cc -I. -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include/ruby -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fPIC -DTARGET_RT_MAC_CFM=0 -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions -Wall -arch i386 -c posix-spawn.c
cc -dynamic -bundle -undefined dynamic_lookup -o posix_spawn_ext.bundle posix-spawn.o -L"." -L"/Users/Owen/.rvm/rubies/jruby-1.6.7/lib" -bundle -framework JavaVM -Wl,-syslibroot, -mmacosx-version-min=10.5 -arch i386
ld: library not found for -lbundle1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [posix_spawn_ext.bundle] Error 1
Gem files will remain installed in /Users/Owen/.rvm/gems/jruby-1.6.7/gems/posix-spawn-0.3.6 for inspection.
Results logged to /Users/Owen/.rvm/gems/jruby-1.6.7/gems/posix-spawn-0.3.6/ext/gem_make.out
An error occured while installing posix-spawn (0.3.6), and Bundler cannot continue.
Make sure that `gem install posix-spawn -v '0.3.6'` succeeds before bundling.
@owenthereal
Copy link
Author

ruby -v: jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) Client VM 1.6.0_29) [darwin-i386-java]

@owenthereal
Copy link
Author

gem install posix-spawn
Building native extensions.  This could take a while...
ERROR:  Error installing posix-spawn:
    ERROR: Failed to build gem native extension.

        /Users/Owen/.rvm/rubies/jruby-1.6.7/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very well.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
`
creating Makefile

make
cc -I. -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include/ruby -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE      -fPIC -DTARGET_RT_MAC_CFM=0  -fno-omit-frame-pointer -fno-strict-aliasing  -fexceptions   -Wall   -arch i386 -c posix-spawn.c
cc -dynamic -bundle -undefined dynamic_lookup  -o posix_spawn_ext.bundle posix-spawn.o -L"." -L"/Users/Owen/.rvm/rubies/jruby-1.6.7/lib" -bundle -framework JavaVM -Wl,-syslibroot, -mmacosx-version-min=10.5   -arch i386  
ld: library not found for -lbundle1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [posix_spawn_ext.bundle] Error 1

@qmx
Copy link

qmx commented Feb 23, 2012

@jinweno, can you provide more info about your environment? how did you install this jruby?

my ruby:
jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]

I don't have a 32bit install/machine to test this :(

@owenthereal
Copy link
Author

@qmx

$ rvm install jruby
jruby-1.6.7 - #fetching 
jruby-1.6.7 - #extracting jruby-bin-1.6.7 to /Users/Owen/.rvm/src/jruby-1.6.7
jruby-1.6.7 - #extracted to /Users/Owen/.rvm/src/jruby-1.6.7
Building Nailgun
jruby-1.6.7 - #installing to /Users/Owen/.rvm/rubies/jruby-1.6.7
jruby-1.6.7 - #importing default gemsets (/Users/Owen/.rvm/gemsets/)
Copying across included gems
Building native extensions.  This could take a while...
Successfully installed jruby-launcher-1.0.12-java
1 gem installed

@owenthereal
Copy link
Author

You can drop your vm to 32 bit with JAVA_OPTS="-d32" and run JRuby on 1.9 mode with JRUBY_OPTS="--1.9"

@owenthereal
Copy link
Author

the gem can be installed on MRI 1.9.3-p125:

$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]

$ gem install posix-spawn
Fetching: posix-spawn-0.3.6.gem (100%)
Building native extensions.  This could take a while...
Successfully installed posix-spawn-0.3.6
1 gem installed

@qmx
Copy link

qmx commented Feb 23, 2012

@jingweno same thing running on 32bits - I couldn't reproduce

please fill a JIRA: http://bugs.jruby.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment