Skip to content

Instantly share code, notes, and snippets.

@ncancelliere
Created February 17, 2014 13:47
Show Gist options
  • Save ncancelliere/9050783 to your computer and use it in GitHub Desktop.
Save ncancelliere/9050783 to your computer and use it in GitHub Desktop.
therubyracer compile failure (gcc4.9)
# Using brew installed gcc49 and compiled Ruby using gcc49 therubyracer fails to build
# (it seems to build okay if Ruby is compiled with gcc42)
$ gem install therubyracer -v '0.12.0'
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/nicholas/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling accessor.cc
g++-4.9: error: unrecognized command line option '-rdynamic'
make: *** [accessor.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@admin/gems/therubyracer-0.12.0 for inspection.
Results logged to /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@admin/extensions/x86_64-darwin-13/2.0.0/therubyracer-0.12.0/gem_make.out
An error occurred while installing therubyracer (0.12.0), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.0'` succeeds before bundling.
------
$ cat ~/.bash_profile
export ARCHFLAGS="-arch x86_64"
export CC="/usr/local/bin/gcc-4.9"
export CXX="/usr/local/bin/g++-4.9"
export CPP="/usr/local/bin/cpp-4.9"
export CPPFLAGS=-I/opt/X11/include
...
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.0.2]
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin13.0.2]
- INSTALLATION DIRECTORY: /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@admin
- RUBY EXECUTABLE: /Users/nicholas/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
- EXECUTABLE DIRECTORY: /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@admin/bin
- SPEC CACHE DIRECTORY: /Users/nicholas/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-13
- GEM PATHS:
- /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@admin
- /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@admin/bin
- /Users/nicholas/.rvm/gems/ruby-2.0.0-p247@global/bin
- /Users/nicholas/.rvm/rubies/ruby-2.0.0-p247/bin
- /Users/nicholas/.rvm/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment