0

I'm using Amazon Linux AMI and I'm trying to run my bundle install with this error:

Installing therubyracer 0.12.2 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby2.0 -r ./siteconf20150914-12081-ne1jzf.rb extconf.rb

checking for main() in -lpthread... yes * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

... ...

Gem files will remain installed in //gems/therubyracer-0.12.2 for inspection. Results logged to //.gem/ruby/2.0/extensions/x86_64-linux/2.0/therubyracer-0.12.2/gem_make.out An error occurred while installing therubyracer (0.12.2), and Bundler cannot continue. Make sure that gem install therubyracer -v '0.12.2' succeeds before bundling.

But the 'gem install therubyracer -v '0.12.2' is not working neither (the same error).

In the file: .gem/ruby/2.0/extensions/x86_64-linux/2.0/therubyracer-0.12.2/mkmf.log

have_library: checking for main() in -lpthread... -------------------- yes

"gcc -o conftest -I/usr/include/ruby/2.0 -I/usr/include/ruby/2.0/ruby/backward -I/usr/include/ruby/2.0 -I.    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC conftest.c  -L. -L/usr/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic  -m64   -L/usr/lib64/ruby/2.0 -lruby  -lpthread -lrt -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -o conftest -I/usr/include/ruby/2.0 -I/usr/include/ruby/2.0/ruby/backward -I/usr/include/ruby/2.0 -I.    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC conftest.c  -L. -L/usr/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic  -m64   -L/usr/lib64/ruby/2.0 -lruby -lpthread  -lpthread -lrt -ldl -lcrypt -lm   -lc"
conftest.c: In function ‘t’:
conftest.c:5:57: error: ‘main’ undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
                                                         ^
conftest.c:5:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:5:32: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
 int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
                                ^
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
 6: int main(int argc, char **argv)
 7: {
 8:   if (argc > 1000000) {
 9:     printf("%p", &t);
10:   }
11: 
12:   return 0;
13: }
/* end */

"gcc -o conftest -I/usr/include/ruby/2.0 -I/usr/include/ruby/2.0/ruby/backward -I/usr/include/ruby/2.0 -I.    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC conftest.c  -L. -L/usr/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic  -m64   -L/usr/lib64/ruby/2.0 -lruby -lpthread  -lpthread -lrt -ldl -lcrypt -lm   -lc"
conftest.c: In function ‘t’:
conftest.c:5:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
 int t(void) { main(); return 0; }
 ^
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int t(void) { main(); return 0; }
 6: int main(int argc, char **argv)
 7: {
 8:   if (argc > 1000000) {
 9:     printf("%p", &t);
10:   }
11: 
12:   return 0;
13: }
/* end */

My versions:

gem -v
2.4.8
rails -v
Rails 4.2.4
ruby -v
ruby 2.0.0p647 (2015-08-18) [x86_64-linux]

Any ideas?

Thanks guys

/Cris

Cris R
  • 1,339
  • 15
  • 27
  • can you just drop it and use node.js, instead? – Brad Werth Sep 14 '15 at 22:01
  • @BradWerth I just commented the line associated with therubyracer and I replaced it with "gem 'node'", then after the bundle: Post-install message from twitter-bootstrap-rails: Important: You may need to add a javascript runtime to your Gemfile in order for bootstrap's LESS files to compile to CSS. ********************************************** ExecJS supports these runtimes: therubyracer - Google V8 embedded within Ruby therubyrhino - Mozilla Rhino embedded within JRuby Node.js Apple JavaScriptCore - Included with Mac OS X Microsoft Windows Script Host (JScript) – Cris R Sep 14 '15 at 22:39
  • In my case this works: http://stackoverflow.com/questions/21690783/clean-install-osx-10-9-1-returns-undefined-method-path2class-when-trying-to/30118186#30118186 – Cris R Sep 15 '15 at 14:01

0 Answers0