Getting Error While doing bundle install with ruby racer - ruby-on-rails

While doing Bundle install for my app, I'm getting an error related to therubyracer (0.9.4).
This is the error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile
make
compiling rr.cpp
clang: warning: argument unused during compilation: '-rdynamic'
rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
rr.cpp:151:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return String::New(RSTRING_PTR(value), RSTRING_LEN(value));
^~~~~~~~~~~~~~~~~~
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:674:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:670:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rr.cpp:151:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return String::New(RSTRING_PTR(value), RSTRING_LEN(value));
^~~~~~~~~~~~~~~~~~
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:675:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
^
3 warnings generated.
compiling v8.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_array.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_callbacks.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_context.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_date.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_debug.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_exception.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_exception.cpp:15:8: warning: unused function 'segfault' [-Wunused-function]
void segfault(int sig) {
^
1 warning generated.
compiling v8_external.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_external.cpp:10:9: warning: unused variable 'references' [-Wunused-variable]
VALUE references;
^
1 warning generated.
compiling v8_function.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_function.cpp:24:23: error: variable length array of non-POD element type 'Handle<v8::Value>'
Handle<Value> argv[argc];
^
v8_function.cpp:36:23: error: variable length array of non-POD element type 'Handle<v8::Value>'
Handle<Value> argv[argc];
^
2 errors generated.
make: *** [v8_function.o] Error 1
Gem files will remain installed in /Users/kpvarma/.rvm/gems/ruby-1.9.3-p194/gems/therubyracer-0.9.4 for inspection.
Results logged to /Users/kpvarma/.rvm/gems/ruby-1.9.3-p194/gems/therubyracer-0.9.4/ext/v8/gem_make.out
An error occured while installing therubyracer (0.9.4), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.9.4'` succeeds before bundling.
I amm using ruby-1.9.3-p194 on Mac.
Can anyone please help me out?
Thank you
Regards

Related

nokogiri not installing in ruby 2.7.1 centos 7.2

Getting below error when installing nokogiri i tried
install -y make gcc rpm-build ruby-devel zlib-devel
gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/ext/nokogiri
/usr/local/rvm/rubies/ruby-2.7.1/bin/ruby -I /usr/local/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0 -r ./siteconf20200716-18065-1jmltdp.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.10
with the following patches applied:
- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
- 0002-Remove-script-macro-support.patch
- 0003-Update-entities-to-remove-handling-of-ssi.patch
- 0004-libxml2.la-is-in-top_builddir.patch
- 0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch
Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.10.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.10... OK
Running patch with /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running patch with /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/patches/libxml2/0002-Remove-script-macro-support.patch... OK
Running patch with /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch... OK
Running patch with /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch... OK
Running patch with /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch... OK
Running 'configure' for libxml2 2.9.10... OK
Running 'compile' for libxml2 2.9.10... OK
Running 'install' for libxml2 2.9.10... OK
Activating libxml2 2.9.10 (from /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/ports/x86_64-pc-linux-gnu/libxml2/2.9.10)...
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxslt-1.1.34.
Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
************************************************************************
Extracting libxslt-1.1.34.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.34... OK
Running 'configure' for libxslt 1.1.34... OK
Running 'compile' for libxslt 1.1.34... OK
Running 'install' for libxslt 1.1.34... OK
Activating libxslt 1.1.34 (from /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/ports/x86_64-pc-linux-gnu/libxslt/1.1.34)...
checking for -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes
checking for exsltFuncRegister() in libexslt/exslt.h... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
current directory: /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/ext/nokogiri
make "DESTDIR=" clean
current directory: /usr/local/rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.10/ext/nokogiri
make "DESTDIR="
compiling html_document.c
compiling html_element_description.c
compiling html_entity_lookup.c
compiling html_sax_parser_context.c
compiling html_sax_push_parser.c
compiling nokogiri.c
compiling xml_attr.c
compiling xml_attribute_decl.c
compiling xml_cdata.c
compiling xml_comment.c
compiling xml_document.c
xml_document.c: In function ‘dealloc’:
xml_document.c:49:3: warning: passing argument 2 of ‘rb_st_foreach’ from incompatible pointer type [enabled by default]
st_foreach(node_hash, dealloc_node_i, (st_data_t)doc);
^
In file included from /usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/intern.h:39:0,
from /usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2148,
from /usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_document.h:4,
from xml_document.c:1:
/usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/st.h:141:5: note: expected ‘int (*)(st_data_t, st_data_t, st_data_t)’ but argument is of type ‘int (*)(struct xmlNode *, struct xmlNode *, struct xmlDoc *)’
int rb_st_foreach(st_table *, st_foreach_callback_func *, st_data_t);
^
xml_document.c: At top level:
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
compiling xml_document_fragment.c
compiling xml_dtd.c
compiling xml_element_content.c
compiling xml_element_decl.c
compiling xml_encoding_handler.c
compiling xml_entity_decl.c
compiling xml_entity_reference.c
compiling xml_io.c
xml_io.c: In function ‘io_read_callback’:
xml_io.c:20:3: warning: passing argument 1 of ‘rb_rescue’ from incompatible pointer type [enabled by default]
string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
^
In file included from /usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:0,
from ./nokogiri.h:33,
from ./xml_io.h:4,
from xml_io.c:1:
**/usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:1987:7: note: expected ‘VALUE (*)(VALUE)’ but argument is of type ‘VALUE (*)(VALUE *)’
VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);**
^
*xml_io.c:20:3: warning: passing argument 3 of ‘rb_rescue’ from incompatible pointer type [enabled by default]
string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
^*
In file included from /usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:0,
from ./nokogiri.h:33,
from ./xml_io.h:4,
from xml_io.c:1:
/usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:1987:7: note: expected ‘VALUE (*)(VALUE, VALUE)’ but argument is of type ‘VALUE (*)(void)’
VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);
^
xml_io.c: In function ‘io_write_callback’:
xml_io.c:47:3: warning: passing argument 1 of ‘rb_rescue’ from incompatible pointer type [enabled by default]
size = rb_rescue(write_check, (VALUE)args, write_failed, 0);
^
In file included from /usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:0,
from ./nokogiri.h:33,
from ./xml_io.h:4,
from xml_io.c:1:
/usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:1987:7:
note: expected ‘VALUE ()(VALUE)’ but argument is of type ‘VALUE
()(VALUE )’
VALUE rb_rescue(VALUE()(VALUE),VALUE,VALUE()(VALUE,VALUE),VALUE);
^
xml_io.c:47:3: warning: passing argument 3 of ‘rb_rescue’ from incompatible pointer type [enabled by default]
size = rb_rescue(write_check, (VALUE)args, write_failed, 0);
^
In file included from /usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:0,
from ./nokogiri.h:33,
from ./xml_io.h:4,
from xml_io.c:1:
/usr/local/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:1987:7:
note: expected ‘VALUE ()(VALUE, VALUE)’ but argument is of type
‘VALUE ()(void)’
VALUE rb_rescue(VALUE()(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);
^
***xml_io.c: At top level:
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
compiling xml_libxml2_hacks.c
compiling xml_namespace.c
compiling xml_node.c
xml_node.c: In function ‘reparent_node_with’:
xml_node.c:304:7: warning: passing argument 1 of ‘xmlFree’ discards ‘const’ qualifier from pointer target type [enabled by default]
xmlFree(reparentee->ns->prefix);
^***
xml_node.c:304:7: note: expected ‘void *’ but argument is of type ‘const xmlChar *’
xml_node.c: At top level:
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
compiling xml_node_set.c
compiling xml_processing_instruction.c
compiling xml_reader.c
compiling xml_relax_ng.c
compiling xml_sax_parser.c
compiling xml_sax_parser_context.c
compiling xml_sax_push_parser.c
compiling xml_schema.c
compiling xml_syntax_error.c
compiling xml_text.c
compiling xml_xpath_context.c
compiling xslt_stylesheet.c
xslt_stylesheet.c:112:13: warning: ‘swallow_superfluous_xml_errors’ defined but not used [-Wunused-function]
static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...)
^
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
linking shared-object nokogiri/nokogiri.so
/usr/bin/ld: unrecognized option '--compress-debug-sections=zlib'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
make: *** [nokogiri.so] Error 1
make failed, exit code 2
as far as my version of centos is old and /usr/bin/ld is a part of binutils, so my suggestion
$ sudo yum update binutils
helped me (instead of full OS update)
My Centos version was 7.6 and all provided solution for nokogiri was not working. Finally i updated centos to 7.8 and it worked. i tried with centos 7.7 version in other server also, it worked on 7.7 also.
i encountered exactly same problem.
It seems that the real error is
/usr/bin/ld: unrecognized option '--compress-debug-sections=zlib'
The flag "--compress-debug-sections=zlib" is defined in file /usr/local/rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10/ext/nokogiri/Makefile .
This makefile is created by a mkmf.rb, and default value of flags are in this file /usr/local/rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/x86_64-linux/rbconfig.rb
CONFIG["DLDFLAGS"] = "-Wl,--compress-debug-sections=zlib"
After I changed this line to be
CONFIG["DLDFLAGS"] = ""
gem install nokogiri works well
But I am not sure about the exactly function of flag "--compress-debug-sections=zlib" and what would happen when i removed it
This error comes because the default linker on Centos 7.4 does not support that option --compress-debug-sections=zlib. Centos 7.8 seems to fix this issue.
But in case you could not switch to Centos 7.8, the option is supported by the gold linker (ld.gold).
To enable the use, you could override the linker by doing something like
ln -s /bin/ld.gold ~/bin/ld; PATH=~/bin:$PATH
then run the needed command

ld.lld command failed when build the hello_world sample in zephyr using clang6.0

I want to build samples/subsys/power/device_pm using clang6.0 so I do as follows:
export ZEPHYR_TOOLCHAIN_VARIANT=llvm
mkdir build and cd build
cmake -DBOARD=reel_board ..
make
Then, I got some errors:
[ 95%] Linking C executable zephyr_prebuilt.elf
clang-6.0: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _OffsetAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _ConfigAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/usr/local/bin/ld.lld: error: linker.cmd:189: { expected, but got ALIGN_WITH_INPUT
>>> _bt_channels_area : ALIGN_WITH_INPUT SUBALIGN(4)
>>> ^
clang-6.0: error: ld.lld command failed with exit code 1 (use -v to see invocation)
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:101: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:557: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Is there any suggestion?
Thanks a lot!
reel_board is ARM right?
ARM is not supported for Clang yet unfortunately.

install older version of therubyracer(v0.9.10) gem on mac mojave

It's my very first time with ruby on rails.
I cloned this project from github.
https://github.com/fredwu/angel_nest
it took me a while to setup and figure out things.
i'm having a lot of compatibility issues as this project was made a long time ago.
when i do "bundle install"
I get this error and bundler stops.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/bin/ruby extconf.rb checking for main() in -lobjc... yes creating Makefile
make compiling v8_external.cpp clang: warning: argument unused during
compilation: '-rdynamic' [-Wunused-command-line-argument]
v8_external.cpp:10:9: warning: unused variable 'references'
[-Wunused-variable] VALUE references;
^ 1 warning generated. compiling v8_exception.cpp clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] v8_exception.cpp:10:16: warning:
unused variable 'stack' [-Wunused-variable] static void* stack[20];
^ 1 warning generated. compiling v8_function.cpp clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_handle.cpp clang:
warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_array.cpp clang:
warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_try_catch.cpp clang:
warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_v8.cpp clang: warning:
argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] v8_v8.cpp:22:49: warning: implicit
conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
V8::SetFlagsFromString(RSTRING_PTR(string), RSTRING_LEN(string));
~~ ^~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6:
note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6:
note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v8_v8.cpp:22:49: warning: implicit conversion loses integer precision:
'long' to 'int' [-Wshorten-64-to-32]
V8::SetFlagsFromString(RSTRING_PTR(string), RSTRING_LEN(string));
~~ ^~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28:
note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~ 2 warnings generated. compiling v8_callbacks.cpp clang: warning: argument unused during compilation:
'-rdynamic' [-Wunused-command-line-argument] compiling v8_string.cpp
clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] v8_string.cpp:18:73: warning:
implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
return rr_v8_handle_new(string_class, String::New(RSTRING_PTR(str), RSTRING_LEN(str)));
~~~~~~ ^~~~~~~~~~~~~~~~
/Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6:
note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6:
note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v8_string.cpp:18:73: warning: implicit conversion loses integer
precision: 'long' to 'int' [-Wshorten-64-to-32]
return rr_v8_handle_new(string_class, String::New(RSTRING_PTR(str), RSTRING_LEN(str)));
~~~~~~ ^~~~~~~~~~~~~~~~
/Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28:
note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~ v8_string.cpp:23:79: warning: implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
return rr_v8_handle_new(string_class, String::NewSymbol(RSTRING_PTR(str), RSTRING_LEN(str)));
~~~~~~ ^~~~~~~~~~~~~~~~
/Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6:
note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6:
note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v8_string.cpp:23:79: warning: implicit conversion loses integer
precision: 'long' to 'int' [-Wshorten-64-to-32]
return rr_v8_handle_new(string_class, String::NewSymbol(RSTRING_PTR(str), RSTRING_LEN(str)));
~~~~~~ ^~~~~~~~~~~~~~~~
/Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28:
note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~ 4 warnings generated. compiling v8_message.cpp clang: warning: argument unused during compilation:
'-rdynamic' [-Wunused-command-line-argument] compiling rr.cpp clang:
warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] rr.cpp:48:1: warning: control reaches
end of non-void function [-Wreturn-type] } ^ rr.cpp:151:44: warning:
implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
return String::New(RSTRING_PTR(value), RSTRING_LEN(value));
~~~~~~ ^~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6:
note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6:
note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rr.cpp:151:44: warning: implicit conversion loses integer precision:
'long' to 'int' [-Wshorten-64-to-32]
return String::New(RSTRING_PTR(value), RSTRING_LEN(value));
~~~~~~ ^~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28:
note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~ 3 warnings generated. compiling v8_weakref.cpp clang: warning: argument unused during compilation:
'-rdynamic' [-Wunused-command-line-argument] compiling v8_script.cpp
clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_date.cpp clang: warning:
argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_debug.cpp clang:
warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_value.cpp clang:
warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] v8_value.cpp:100:9: warning: unused
function 'ToInt32' [-Wunused-function] VALUE ToInt32(VALUE self) {
^ 1 warning generated. compiling v8_object.cpp clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] v8_object.cpp:77:19: warning: unused
variable 'proto' [-Wunused-variable]
Handle proto(rr_rb2v8(prototype));
^ 1 warning generated. compiling v8_locker.cpp clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] v8_locker.cpp:45:5: warning: control
reaches end of non-void function [-Wreturn-type]
}
^ v8_locker.cpp:85:5: warning: control reaches end of non-void function [-Wreturn-type]
}
^ 2 warnings generated. compiling v8_template.cpp clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8.cpp clang: warning:
argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] compiling v8_context.cpp clang:
warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument] linking shared-object v8.bundle
clang: error: no such file or directory:
'/Users/divyanshuverma/angel_nest/vendor/cache/ruby/1.9.1/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a'
make: *** [v8.bundle] Error 1
Gem files will remain installed in
/Users/divyanshuverma/angel_nest/vendor/cache/ruby/1.9.1/gems/therubyracer-0.9.10
for inspection. Results logged to
/Users/divyanshuverma/angel_nest/vendor/cache/ruby/1.9.1/gems/therubyracer-0.9.10/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.9.10), and Bundler
cannot continue. Make sure that gem install therubyracer -v '0.9.10'
succeeds before bundling.
i've tried all approaches available on stackoverflow for this method but none works!
is there any way to override the requirements of this gem make changes such that project works on the newer version of therubyracer gem
This version is locked only by Gemfile.lock, which means that there're probably no specific requirements in project itself.
You can try updating just this gem without full bundle update via: bundle update therubyracer, most probably newer version will do ok.

Error when installing json gem for ruby 2.0

I'm running ruby 2.0.0p0 on Mac OSX 10.9 and trying to installing the gem json but keep getting an error message that it has failed to build the gem native extension.
I attempted to update the rubygems with: gem update --system but still get the same error message.
Do I need to possibly install a different version of json (other than 1.8.1) for the version of ruby I am running?
Here is the full output in case that helps to see the issue:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:51:21: error: string.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:61:21: error: stdint.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:64:23: error: inttypes.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:68:19: error: stdio.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:70,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/defines.h:29:21: error: stdlib.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:194,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1566,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:23:45: error: math.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:29:24: error: sys/time.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:38:25: error: sys/types.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1566,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:57: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__syscall’
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:34,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1567,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/st.h:140: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1567,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:318: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: warning: ‘struct timeval’ declared inside parameter list
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: warning: ‘struct timeval’ declared inside parameter list
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:409: warning: ‘struct timeval’ declared inside parameter list
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:505: error: expected declaration specifiers or ‘...’ before ‘mode_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:584: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:598: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:599: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork_err’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:601: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:602: error: expected ‘)’ before ‘pid’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:603: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:604: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:606: error: expected ‘)’ before ‘pid’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:719: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:842: error: expected ‘)’ before ‘long’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:843: error: expected ‘)’ before ‘long’
In file included from generator.c:1:
../fbuffer/fbuffer.h: In function ‘fbuffer_alloc’:
../fbuffer/fbuffer.h:72: warning: implicit declaration of function ‘memset’
../fbuffer/fbuffer.h:72: warning: incompatible implicit declaration of built-in function ‘memset’
../fbuffer/fbuffer.h: In function ‘fbuffer_append’:
../fbuffer/fbuffer.h:109: warning: implicit declaration of function ‘memcpy’
../fbuffer/fbuffer.h:109: warning: incompatible implicit declaration of built-in function ‘memcpy’
In file included from generator.c:2:
generator.h:6:19: error: ctype.h: No such file or directory
generator.c: In function ‘fstrndup’:
generator.c:304: warning: implicit declaration of function ‘memccpy’
generator.c: At top level:
generator.c:380: warning: unused parameter ‘self’
generator.c: In function ‘mString_to_json_raw_object’:
generator.c:410: warning: implicit declaration of function ‘strlen’
generator.c:410: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:411: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘mString_Extend_json_create’:
generator.c:438: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:439: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: At top level:
generator.c:434: warning: unused parameter ‘self’
generator.c: In function ‘State_allocate’:
generator.c:505: warning: incompatible implicit declaration of built-in function ‘memset’
generator.c: In function ‘set_state_ivars’:
generator.c:611: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_aref’:
generator.c:657: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_aset’:
generator.c:671: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:675: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: At top level:
generator.c:767: warning: unused parameter ‘Vstate’
generator.c:781: warning: unused parameter ‘Vstate’
generator.c:781: warning: unused parameter ‘state’
generator.c:781: warning: unused parameter ‘obj’
generator.c:786: warning: unused parameter ‘Vstate’
generator.c:786: warning: unused parameter ‘state’
generator.c:786: warning: unused parameter ‘obj’
generator.c:791: warning: unused parameter ‘Vstate’
generator.c:791: warning: unused parameter ‘state’
generator.c:791: warning: unused parameter ‘obj’
generator.c:796: warning: unused parameter ‘Vstate’
generator.c:796: warning: unused parameter ‘state’
generator.c:801: warning: unused parameter ‘Vstate’
generator.c:801: warning: unused parameter ‘state’
generator.c: In function ‘generate_json_float’:
generator.c:813: warning: implicit declaration of function ‘isinf’
generator.c:816: warning: implicit declaration of function ‘isnan’
generator.c: At top level:
generator.c:807: warning: unused parameter ‘Vstate’
generator.c: In function ‘isArrayOrObject’:
generator.c:905: warning: implicit declaration of function ‘isspace’
generator.c: In function ‘cState_init_copy’:
generator.c:972: warning: incompatible implicit declaration of built-in function ‘memcpy’
generator.c: In function ‘cState_indent’:
generator.c:1013: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_indent_set’:
generator.c:1035: warning: implicit declaration of function ‘strdup’
generator.c:1035: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_space’:
generator.c:1050: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_space_set’:
generator.c:1073: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_space_before’:
generator.c:1087: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_space_before_set’:
generator.c:1109: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_object_nl’:
generator.c:1124: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_object_nl_set’:
generator.c:1146: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_array_nl’:
generator.c:1160: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_array_nl_set’:
generator.c:1181: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘Init_generator’:
generator.c:1402: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1403: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1404: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1405: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1406: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1407: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1408: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1409: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1410: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1411: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1412: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1413: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1414: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1415: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1416: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1417: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1418: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1419: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1420: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1421: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1422: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1423: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1424: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1425: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1426: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1427: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1429: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1429: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1430: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1431: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1433: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [generator.o] Error 1
make failed, exit code 2
Add this in your gemfile
gem 'therubyracer', :platforms => :ruby
Then run bundle install.

Why does therubyracer fails to build on my Debian?

I want to update to rails 3.2, but the build process of therubyracer (0.9.9) fails. I've no clue what I've to do.
My environment:
Debian Squeeze (2.6.32-5-amd64)
make
compiling v8_external.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_external.cpp:4:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::External]’:
v8_external.cpp:51: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_external.cpp: At global scope:
v8_external.cpp:10: warning: ‘<unnamed>::references’ defined but not used
compiling v8_context.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_context.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Context]’:
v8_context.cpp:15: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::ObjectTemplate]’:
v8_context.cpp:22: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Value]’:
v8_context.cpp:23: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_value.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_value.cpp:1:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Value]’:
v8_value.cpp:10: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_message.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_message.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Message]’:
v8_message.cpp:10: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_date.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_date.cpp:4:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Date]’:
v8_date.cpp:21: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_handle.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_v8.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_callbacks.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_array.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_array.cpp:1:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Array]’:
v8_array.cpp:13: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_exception.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_exception.cpp:3:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::StackTrace]’:
v8_exception.cpp:48: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::StackFrame]’:
v8_exception.cpp:68: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_exception.cpp: At global scope:
v8_exception.cpp:10: warning: ‘<unnamed>::stack’ defined but not used
compiling v8_weakref.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_debug.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_function.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_function.cpp:5:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Function]’:
v8_function.cpp:13: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Array]’:
v8_function.cpp:23: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::String]’:
v8_function.cpp:49: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_object.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_object.cpp:1:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Object]’:
v8_object.cpp:17: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_locker.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
v8_locker.cpp: In function ‘VALUE<unnamed>::Lock::Delete(VALUE)’:
v8_locker.cpp:45: warning: no return statement in function returning non-void
v8_locker.cpp: In function ‘VALUE<unnamed>::Unlock::Delete(VALUE)’:
v8_locker.cpp:85: warning: no return statement in function returning non-void
compiling v8_script.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_script.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Script]’:
v8_script.cpp:25: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_string.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_string.cpp:3:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::String]’:
v8_string.cpp:13: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling rr.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
rr.cpp: In function ‘VALUE rr_define_finalizer(VALUE, void*, VALUE)’:
rr.cpp:48: warning: no return statement in function returning non-void
In file included from rr.cpp:3:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Value]’:
rr.cpp:159: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_template.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_template.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Template]’:
v8_template.cpp:42: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::ObjectTemplate]’:
v8_template.cpp:45: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::FunctionTemplate]’:
v8_template.cpp:48: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Data]’:
v8_template.cpp:54: instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_try_catch.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
linking shared-object v8.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(functexcept.o): relocation R_X86_64_32 against `std::bad_typeid::~bad_typeid()' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [v8.so] Error 1
UPDATE
I've tried the following:
Downloaded a copy of the source git clone https://github.com/cowboyd/therubyracer.git
Added $CPPFLAGS += " -fPIC" to the ext/v8/extconf.rb
Built gem with gem build therubyracer.gemspec
Installed gem with gem install therubyracer-0.9.9.gem
Same error was shown to me! Issue: https://github.com/cowboyd/therubyracer/issues/135
On a debian (686 with amd64 kernel) I had to uninstall livb8, download the gem and recompile for my architecture
gem uninstall libv8
wget http://rubygems.org/downloads/libv8-3.3.10.4.gem
ARCHFLAG='-arch i386' gem install ./libv8-3.3.10.4.gem
ARCHFLAG='-arch i386' gem install therubyracer
Then therubyracer (0.10.1) installed fine.
recompile with -fPIC
Have you tried adding -fPIC as an additional build flag? You can test it out in a gem install:
$ gem install therubyracer -- -fPIC
Or, with Bundler:
$ bundle config build.therubyracer -fPIC
It looks like someone else pointed it out in an issue. You might want to check it out if the above doesn't work.
One solution is to run the version 0.9.8 as version 0.9.9. (solves not the real problem):
Clone therubyracer's source git clone https://github.com/cowboyd/therubyracer.git
Checkout tag v0.9.8 git checkout v0.9.8
Change version number in ./lib/v8/version.rb to 0.9.9
Build the gem gem build therubyracer.gemspec
Install the gem gem install therubyracer-0.9.9.gem

Resources