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
Related
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.
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.
I am developing Rails Application on OSX.
I got success on my Mac book pro, but I got error on MacPro when exec 'bundle install'.
Their environment are almost same.
os: OSX High Sierra v10.13.4
postgres: v9.6.8 (I installed it by Homebrew)
ruby:
version: 2.4.2 on MacPro, 2.4.0 on MacBookPro
installed by: rbenv
which: /Users/makiaki/.rbenv/shims/ruby
gem-version: 2.6.13
bunler-version: 1.16.1
Firstly, I was using postgresql version 10.1.
In my MacBookPro, got success with postgresql version 9.6.
Then I tried to uninstall postgresql and installed postgresql version 9.6.
But both way is not effectiveness.
I have got error when exec bundle install or bundle install --path vendor/bundle .
How can I fix this problem?
And this is console:
Fetching pg 0.21.0
Installing pg 0.21.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/makiaki/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/pg-0.21.0/ext
/Users/makiaki/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20180419-22579-1fcqwvi.rb extconf.rb
checking for pg_config... yes
Using config values from /Users/makiaki/.pyenv/shims/pg_config
pyenv: pg_config: command not found
The `pg_config' command exists in these Python versions:
anaconda3-4.3.0
pyenv: pg_config: command not found
The `pg_config' command exists in these Python versions:
anaconda3-4.3.0
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQescapeLiteral()... yes
checking for PQescapeIdentifier()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... yes
checking for PQping()... yes
checking for PQsetSingleRowMode()... yes
checking for PQconninfo()... yes
checking for PQsslAttribute()... yes
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_fd_select()... yes
checking for rb_w32_wrap_io_handle()... no
checking for rb_str_modify_expand()... yes
checking for rb_hash_dup()... yes
checking for PGRES_COPY_BOTH in libpq-fe.h... yes
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... yes
checking for PG_DIAG_TABLE_NAME in libpq-fe.h... yes
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for inttypes.h... yes
checking for ruby/st.h... yes
checking for C99 variable length arrays... yes
creating extconf.h
creating Makefile
current directory: /Users/makiaki/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/pg-0.21.0/ext
make "DESTDIR=" clean
current directory: /Users/makiaki/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/pg-0.21.0/ext
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
compiling pg_binary_decoder.c
compiling pg_binary_encoder.c
compiling pg_coder.c
pg_coder.c:200:34: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
res = this->dec_func(this, val, RSTRING_LEN(argv[0]), tuple, field, ENCODING_GET(argv[0]));
~~~~ ^~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:980:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pg_coder.c:200:34: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
res = this->dec_func(this, val, RSTRING_LEN(argv[0]), tuple, field, ENCODING_GET(argv[0]));
~~~~ ^~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:981:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~
2 warnings generated.
compiling pg_connection.c
compiling pg_copy_coder.c
pg_copy_coder.c:225:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
strlen = RSTRING_LEN(subint);
~ ^~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:980:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pg_copy_coder.c:225:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
strlen = RSTRING_LEN(subint);
~ ^~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:981:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~
pg_copy_coder.c:531:23: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
input_len = end_ptr - start_ptr;
~ ~~~~~~~~^~~~~~~~~~~
3 warnings generated.
compiling pg_errors.c
compiling pg_result.c
compiling pg_text_decoder.c
compiling pg_text_encoder.c
pg_text_encoder.c:170:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
len = out - start;
~ ~~~~^~~~~~~
pg_text_encoder.c:289:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return optr - out;
~~~~~~ ~~~~~^~~~~
pg_text_encoder.c:293:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return 2 + RSTRING_LEN(*intermediate) * 2;
~~~~~~ ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pg_text_encoder.c:501:13: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
nr_elems = RARRAY_LEN(value);
~ ^~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:1026:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
^~~~~~~~~~~~~~~
4 warnings generated.
compiling pg_type_map.c
compiling pg_type_map_all_strings.c
compiling pg_type_map_by_class.c
compiling pg_type_map_by_column.c
pg_type_map_by_column.c:161:52: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return dec_func( p_coder, RSTRING_PTR(field_str), RSTRING_LEN(field_str), 0, fieldno, enc_idx );
~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:980:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pg_type_map_by_column.c:161:52: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return dec_func( p_coder, RSTRING_PTR(field_str), RSTRING_LEN(field_str), 0, fieldno, enc_idx );
~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:981:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~
pg_type_map_by_column.c:230:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
conv_ary_len = RARRAY_LEN(conv_ary);
~ ^~~~~~~~~~~~~~~~~~~~
/Users/makiaki/.rbenv/versions/2.4.2/include/ruby-2.4.0/ruby/ruby.h:1026:23: note: expanded from macro 'RARRAY_LEN'
#define RARRAY_LEN(a) rb_array_len(a)
^~~~~~~~~~~~~~~
3 warnings generated.
compiling pg_type_map_by_mri_type.c
compiling pg_type_map_by_oid.c
compiling pg_type_map_in_ruby.c
compiling util.c
util.c:119:24: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return (char*)out_ptr - out;
~~~~~~ ~~~~~~~~~~~~~~~^~~~~
1 warning generated.
linking shared-object pg_ext.bundle
ld: file not found: dynamic_lookup
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pg_ext.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/makiaki/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/pg-0.21.0 for inspection.
Results logged to /Users/makiaki/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/pg-0.21.0/gem_make.out
An error occurred while installing pg (0.21.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.21.0'` succeeds before bundling.
In Gemfile:
pg
The point is that:
Using config values from /Users/makiaki/.pyenv/shims/pg_config
pyenv: pg_config: command not found
The `pg_config' command exists in these Python versions:
anaconda3-4.3.0
pyenv: pg_config: command not found
The `pg_config' command exists in these Python versions:
anaconda3-4.3.0
I tried this command:
$ which pg_config
It shows:
/Users/makiaki/.pyenv/shims/pg_config
It is not good.
Fixing ~/.zshrc such like this:
# postgres
export PATH="/usr/local/opt/postgresql#9.6/bin:$PATH"
In this case, it is the mainly problem to put correct pg_config PATH before pyenv PATH setting in my .zshrc .
Fixing that, getting success.
I was getting the same error message, but the log showed I was having a different issue:
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
Running brew link postgresql resolved it
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
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