gem install io-extra -v '1.2.6' fails - ruby

My ruby version is 2.2.0
As a part of installing manageiq software, I have to run the following install:
gem install io-extra -v '1.2.6'
I get this error:
eugene#3b4d8a92ac5d:~/manageiq/vmdb/manageiq/vmdb$ gem install io-extra -v '1.2.6'
Building native extensions. This could take a while...
ERROR: Error installing io-extra:
ERROR: Failed to build gem native extension.
/home/eugene/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150211-16945-9agvpk.rb extconf.rb
checking for stdint.h... yes
checking for sys/resource.h... yes
checking for sys/uio.h... yes
checking for closefrom()... no
checking for fdwalk()... no
checking for directio()... no
checking for pread()... yes
checking for pwrite()... yes
checking for writev()... yes
checking for rb_str_set_len() in ruby.h... yes
checking for rb_thread_blocking_region()... no
checking for ttyname()... yes
checking for O_DIRECT in sys/types.h,fcntl.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling io/extra.c
In file included from io/extra.c:41:0:
/home/eugene/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete [-Wcpp]
#warning rubysig.h is obsolete
^
io/extra.c: In function 'rb_thread_blocking_region':
io/extra.c:52:4: error: 'TRAP_BEG' undeclared (first use in this function)
TRAP_BEG;
^
io/extra.c:52:4: note: each undeclared identifier is reported only once for each function it appears in
io/extra.c:54:4: error: 'TRAP_END' undeclared (first use in this function)
TRAP_END;
^
make: *** [extra.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/eugene/.rvm/gems/ruby-2.2.0/gems/io-extra-1.2.6 for inspection.
Results logged to /home/eugene/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/io-extra-1.2.6/gem_make.out
What can I do to overcome this error?

The answer came from asking folks at manageiq:
http://talk.manageiq.org/t/how-to-properly-install-manageiq-from-source-on-ubuntu/539
They recommended installing ruby 2.0.0 and it worked well.

Related

Jekyll eventmachine 1.2.7 error on bundle

I'm trying to run bundle install using ubuntu 20.04, rvm with ruby 2.7.2, and I can't get the eventmachine gem to install.
After googling for hours I couldn't find a solution that works for me. I've tried deleting the lockfile and running bundle, ruby-dev is already installed with the latest version, I've tried running bundle with ruby 2.6.6, updating bundle, updating Jekyll from 4.0.0 to 4.2.0, and no matter what I try I'm still getting these error messages I don't understand, so any help would be VERY appreciated!
Gemfile
source 'https://rubygems.org'
gem 'jekyll', '4.0.0'
group :jekyll_plugins do
gem 'jekyll-feed', '0.12.1'
gem 'jekyll-paginate', '1.1.0'
gem 'jekyll-seo-tag', '2.6.1'
gem 'jekyll-sitemap', '1.3.1'
end
Relevant bundle log
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
/home/jordan/.rvm/rubies/ruby-2.7.2/bin/ruby -I /home/jordan/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20210214-26199-1f75y70.rb extconf.rb
checking for -lcrypto... yes
checking for -lssl... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... yes
checking for accept4() in sys/socket.h... yes
checking for SOCK_CLOEXEC in sys/socket.h... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
checking for clock_gettime()... yes
checking for CLOCK_MONOTONIC_RAW in time.h... yes
checking for CLOCK_MONOTONIC in time.h... yes
CXXFLAGS=-g -O2 -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
make "DESTDIR=" clean
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
make "DESTDIR="
compiling binder.cpp
compiling cmain.cpp
compiling ed.cpp
compiling em.cpp
em.cpp: In member function ‘void EventMachine_t::SignalLoopBreaker()’:
em.cpp:316:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
316 | (void)write (LoopBreakerWriter, "", 1);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
em.cpp: In member function ‘void EventMachine_t::_ReadLoopBreaker()’:
em.cpp:1109:13: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
1109 | (void)read (LoopBreakerReader, buffer, sizeof(buffer));
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:77:13: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
77 | (void)read (GetSocket(), &c, 1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
compiling page.cpp
compiling pipe.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘void event_callback_wrapper(uintptr_t, int, const char*, long unsigned int)’:
rubymain.cpp:220:105: warning: ‘VALUE ruby::backward::cxxanyargs::rb_rescue(VALUE (*)(...), VALUE, VALUE (*)(...), VALUE)’ is deprecated: Use of ANYARGS in this function is deprecated
[-Wdeprecated-declarations]
220 | rb_rescue((VALUE (*)(ANYARGS))event_callback, (VALUE)&e, (VALUE (*)(ANYARGS))event_error_handler, Qnil);
| ^
In file included from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/ruby.h:2863,
from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby.h:33,
from em.h:24,
from project.h:168,
from rubymain.cpp:20:
/home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/backward/cxxanyargs.hpp:198:1: note: declared here
198 | rb_rescue(type *q, VALUE w, type *e, VALUE r)
| ^~~~~~~~~
rubymain.cpp:220:105: warning: ‘VALUE ruby::backward::cxxanyargs::rb_rescue(VALUE (*)(...), VALUE, VALUE (*)(...), VALUE)’ is deprecated: Use of ANYARGS in this function is deprecated
[-Wdeprecated-declarations]
220 | rb_rescue((VALUE (*)(ANYARGS))event_callback, (VALUE)&e, (VALUE (*)(ANYARGS))event_error_handler, Qnil);
| ^
In file included from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/ruby.h:2863,
from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby.h:33,
from em.h:24,
from project.h:168,
from rubymain.cpp:20:
/home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/backward/cxxanyargs.hpp:198:1: note: declared here
198 | rb_rescue(type *q, VALUE w, type *e, VALUE r)
| ^~~~~~~~~
compiling ssl.cpp
linking shared-object rubyeventmachine.so
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.time] Error 127
make install failed, exit code 2
Gem files will remain installed in /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7 for inspection.
Results logged to /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/eventmachine-1.2.7/gem_make.out
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
jekyll-feed was resolved to 0.12.1, which depends on
jekyll was resolved to 4.0.0, which depends on
em-websocket was resolved to 0.5.2, which depends on
eventmachine
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
/home/jordan/.rvm/rubies/ruby-2.7.2/bin/ruby -I /home/jordan/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20210214-26199-8qwb9v.rb extconf.rb
creating Makefile
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR=" clean
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR="
compiling ruby_http_parser.c
compiling ryah_http_parser.c
linking shared-object ruby_http_parser.so
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.time] Error 127
make install failed, exit code 2
Gem files will remain installed in /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/http_parser.rb-0.6.0/gem_make.out
An error occurred while installing http_parser.rb (0.6.0), and Bundler cannot continue.
Make sure that `gem install http_parser.rb -v '0.6.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
jekyll-feed was resolved to 0.12.1, which depends on
jekyll was resolved to 4.0.0, which depends on
em-websocket was resolved to 0.5.2, which depends on
http_parser.rb
I tried again, this time using ruby 2.7.1 instead of 2.7.2 and it worked.
I guess some update in ruby broke it, so for anyone stuck on this try using 2.7.1 or not the latest version of ruby.

Rails Error Running Gem Install PG

I am trying to push my app to Heroku and I configured my gemfile as such:
group :production do
gem 'pg', '0.18.4'
gem 'rails_12factor', '0.0.2'
gem 'puma'
end
And I am getting this error in my console when running bundle install:
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
Then when I run gem install pg -v '0.18.4', I get the following:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
When I run sudo gem install pg -v '0.18.4'
I get the following:
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.0.0/gems/pg-0.18.4/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160125-5501-ugsd1s.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
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... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
UPDATE
I reinstalled RVM and rails and now when I run gem install pg -v '0.18.4', it runs successfully:
Successfully installed pg-0.18.4
Parsing documentation for pg-0.18.4
Done installing documentation for pg after 3 seconds
1 gem installed
But when run bundle install, I get this:
Installing pg 0.18.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/benwong/Desktop/ruby/rails_projects/blog2/vendor/bundle/ruby/2.2.0/gems/pg-0.18.4/ext
/Users/benwong/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160126-44660-1ufenyc.rb extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/MacOS/bin/pg_config
sh: /Applications/Postgres.app/Contents/MacOS/bin/pg_config: No such file or directory
sh: /Applications/Postgres.app/Contents/MacOS/bin/pg_config: No such file or directory
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 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
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/benwong/Desktop/ruby/rails_projects/blog2/vendor/bundle/ruby/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.4/mkmf.log
current directory: /Users/benwong/Desktop/ruby/rails_projects/blog2/vendor/bundle/ruby/2.2.0/gems/pg-0.18.4/ext
make "DESTDIR=" clean
current directory: /Users/benwong/Desktop/ruby/rails_projects/blog2/vendor/bundle/ruby/2.2.0/gems/pg-0.18.4/ext
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
compiling pg_binary_decoder.c
compiling pg_binary_encoder.c
compiling pg_coder.c
compiling pg_connection.c
pg_connection.c:2394:3: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
gettimeofday(&currtime, NULL);
^
1 warning generated.
compiling pg_copy_coder.c
compiling pg_errors.c
compiling pg_result.c
compiling pg_text_decoder.c
compiling pg_text_encoder.c
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
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
linking shared-object pg_ext.bundle
ld: warning: directory not found for option '-L/Users/haven/.sm/pkg/active/lib'
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/benwong/Desktop/ruby/rails_projects/blog2/vendor/bundle/ruby/2.2.0/gems/p
g-0.18.4 for inspection.
Results logged to /Users/benwong/Desktop/ruby/rails_projects/blog2/vendor/bundle/ruby/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.4/gem_make.out
Using puma 2.15.3
Using rails_serve_static_assets 0.0.4
Using rails_stdout_logging 0.0.4
Using sass 3.4.21
Using tilt 2.0.2
Using spring 1.6.2
Using rdoc 4.2.1
Using tzinfo 1.2.2
Using nokogiri 1.6.7.2
Using rack-test 0.6.3
Using warden 1.2.4
Using mail 2.6.3
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using uglifier 2.7.2
Using sprockets 3.5.2
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
You need to have PostgreSQL installed to install pg gem. Also PATHs will need to be configured.
You can use http://postgresapp.com/ to easily install PostgreSQL on Mac. And use this to configure PATH: http://postgresapp.com/documentation/cli-tools.html
Try this it worked for me it must Have all psql dependency so it will work
sudo apt-get install -y libpq-dev build-essential postgresql-server-dev-all libpgsql-ruby postgresql ruby-dev && gem install pg

Gem::Ext::BuildError: ERROR: Failed to build gem native extension(ffi gem) - windows

When I run bundle install, it fails when it try to install ffi gem with native extension. I get this error
Installing ffi 1.8.1 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/Ruby21-x64/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make "DESTDIR="
generating ffi_c-x64-mingw32.def
Configuring libffi
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: WARNING: cache variable lt_cv_path_LD contains a newline
configure: WARNING: cache variable lt_cv_path_LD contains a newline
make -C "/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32"
make[1]: Entering directory `/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32'
Makefile:318: *** missing separator. Stop.
make[1]: Leaving directory `/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32'
make: *** ["/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32"/.libs/libffi_convenience.a] Error 2
Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.
I am on windows 7 with ruby 2.1.7 and rails 3.2. I have found different solution like updating system gems and downgrading ffi version but none of them is working for me. How can I solve this problem?

mysql2 gem fail to compile on os x lion

Configuration:
OS X Lion 10.7.5
XCode command line tools installed through xcode462_cltools_10_76938260a.dmg
MySQL installed through mysql-5.6.12-osx10.7-x86_64.dmg
ruby-1.9.3-p327 through rvm
Launching:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config
The result is:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/edo/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
compiling client.c
In file included from client.c:1:
In file included from ./mysql2_ext.h:8:
In file included from /Users/edo/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32:
/Users/edo/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:105:37: error: 'ruby_check_sizeof_long' declared as an array with a negative size
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/edo/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/x86_64-darwin11.4.2/ruby/config.h:24:21: note: expanded from macro 'SIZEOF_LONG'
#define SIZEOF_LONG 8
and more.
Any suggestion?

Problems installing Nokogiri (1.5.2) on Ubuntu 12.10

I'm running Ubuntu 12.10, and, when I run the command:
bundle install
I get:
Installing nokogiri (1.5.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... 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
make
compiling xml_processing_instruction.c
compiling xml_node.c
compiling html_entity_lookup.c
compiling xml_syntax_error.c
compiling xml_document.c
xml_document.c: In function ‘set_encoding’:
xml_document.c:159:12: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
xml_document.c: In function ‘canonicalize’:
xml_document.c:505:15: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
compiling xml_encoding_handler.c
compiling xml_namespace.c
xml_namespace.c: In function ‘prefix’:
xml_namespace.c:14:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
xml_namespace.c: In function ‘href’:
xml_namespace.c:33:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
compiling xml_entity_decl.c
compiling xml_attribute_decl.c
compiling xml_comment.c
compiling xml_dtd.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:189:3: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Error 1
Gem files will remain installed in /home/site/.bundler/tmp/19240/gems/nokogiri-1.5.2 for inspection.
Results logged to /home/site/.bundler/tmp/19240/gems/nokogiri-1.5.2/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.5.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.2'` succeeds before bundling.
When I run:
gem install nokogiri -v '1.5.2'
I get:
site#ubuntu:~/Documents/shopqi$ gem install nokogiri -v '1.5.2'
malloc_limit=60000000 (8000000)
free_min=50000 (4096)
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.2
1 gem installed
Installing ri documentation for nokogiri-1.5.2...
Installing RDoc documentation for nokogiri-1.5.2...
site#ubuntu:~/Documents/shopqi$
There's no error, but if I try bundle install again I get the error that Nokogiri is not installed.
the content of gem_make.out after running sudo gem install nokogiri -v '1.5.2' is:
/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... 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
make
compiling xml_processing_instruction.c
compiling xml_node.c
compiling html_entity_lookup.c
compiling xml_syntax_error.c
compiling xml_document.c
xml_document.c: In function ‘set_encoding’:
xml_document.c:159:12: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
xml_document.c: In function ‘canonicalize’:
xml_document.c:505:15: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
compiling xml_encoding_handler.c
compiling xml_namespace.c
xml_namespace.c: In function ‘prefix’:
xml_namespace.c:14:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
xml_namespace.c: In function ‘href’:
xml_namespace.c:33:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
compiling xml_entity_decl.c
compiling xml_attribute_decl.c
compiling xml_comment.c
compiling xml_dtd.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:189:3: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Error 1
Any help please?
Try this first:
$ apt-get install libxml2-dev libxslt1-dev
Also, if you're using rvm, do:
$ rvm requirements
Ubuntu 12.10 adopts Debian's hardening wrapper, which includes a set of default flags for GCC that cause this compilation error. We've worked around this in Nokogiri 1.5.4 and higher, so you'll need to either upgrade or find your own workaround.
See here for information on Debian hardening.
See here for details on the solution used by Team Nokogiri.

Resources