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.
Related
I had a problem trying to run the ruby project OPEN-NDC-PROJECT.
bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.3
Using concurrent-ruby 1.1.8
Using i18n 1.5.1
Using minitest 5.14.3
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using activesupport 5.0.7.2
Using activemodel 5.0.7.2
Using arel 7.1.4
Using activerecord 5.0.7.2
Using awesome_print 1.8.0
Using descendants_tracker 0.0.4
Using ice_nine 0.11.2
Using axiom-types 0.1.1
Using dependor 1.0.1
Using bogus 0.1.6
Using builder 3.2.4
Using bundler 1.17.3
Using chronic 0.10.2
Using coderay 1.1.3
Using coercible 1.0.0
Using daemons 1.3.1
Using database_cleaner-core 2.0.1
Using database_cleaner-active_record 2.0.0
Using database_cleaner 2.0.1
Using diffy 3.4.0
Using equalizer 0.0.11
Fetching eventmachine 1.2.7
Installing eventmachine 1.2.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/userName/.rbenv/versions/2.2.2/bin/ruby -r
./siteconf20210217-76181-1jmnsjp.rb extconf.rb
--with-cppflags=-I/usr/local/opt/openssl/include
checking for main() in -lcrypto... no
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()... no
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... no
checking for accept4() in sys/socket.h... no
checking for SOCK_CLOEXEC in sys/socket.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for clock_gettime()... no
checking for gethrtime()... no
CXXFLAGS=$(cxxflags) -Wall -Wextra -Wno-deprecated-declarations
-Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling page.cpp
compiling pipe.cpp
compiling binder.cpp
compiling rubymain.cpp
compiling ssl.cpp
compiling ed.cpp
compiling cmain.cpp
compiling em.cpp
em.cpp:706:13: error: use of undeclared identifier 'rb_thread_select'; did you
mean 'rb_thread_fd_select'?
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~~~~~~~~~
rb_thread_fd_select
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:5:
note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct
timeval *);
^
em.cpp:706:40: error: cannot initialize a parameter of type 'rb_fdset_t *' with an
rvalue of type 'fd_set *'
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:42:
note: passing argument to parameter here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct
timeval *);
^
2 errors generated.
make: *** [em.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/userName/RubymineProjects/ndc-sandbox/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.2.7
for inspection.
Results logged to
/Users/userName/RubymineProjects/ndc-sandbox/vendor/bundle/ruby/2.2.0/extensions/x86_64-darwin-19/2.2.0-static/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:
thin was resolved to 1.8.0, which depends on
eventmachine
gem_make.out
/Users/userName/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20210217-73483-4tmlc2.rb extconf.rb --with-cppflags=-I/usr/local/opt/openssl/include
checking for main() in -lcrypto... no
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()... no
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... no
checking for accept4() in sys/socket.h... no
checking for SOCK_CLOEXEC in sys/socket.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for clock_gettime()... no
checking for gethrtime()... no
CXXFLAGS=$(cxxflags) -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling page.cpp
compiling pipe.cpp
compiling binder.cpp
compiling rubymain.cpp
compiling ssl.cpp
compiling ed.cpp
compiling cmain.cpp
compiling em.cpp
em.cpp:706:13: error: use of undeclared identifier 'rb_thread_select'; did you mean 'rb_thread_fd_select'?
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~~~~~~~~~
rb_thread_fd_select
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:5: note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
em.cpp:706:40: error: cannot initialize a parameter of type 'rb_fdset_t *' with an rvalue of type 'fd_set *'
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:42: note: passing argument to parameter here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
2 errors generated.
make: *** [em.o] Error 1
make failed, exit code 2
Gemfile
source 'https://rubygems.org'
ruby '2.2.2'
gem 'json' # JSON
gem 'foreman' # Process management
gem 'racksh'
gem 'thin'
gem 'rack-cors', :require => 'rack/cors'
gem 'sprockets'
gem 'rake'
# Formatting
gem 'nokogiri'
gem 'chronic'
gem 'htmlentities', '~> 4.3', '>= 4.3.4'
# DB
gem 'pg'
gem 'activerecord', '~> 5.0.0' # Database
gem 'redis', '~>3.2'
# API Framework
gem 'grape'
group :development do
gem 'rb-readline'
gem 'rerun'
gem 'mina' # Deployment
end
group :test do
gem 'test-unit'
gem "rack-test", require: "rack/test"
gem 'test_xml'
gem 'bogus'
gem 'database_cleaner'
gem 'timecop'
end
group :development, :test do
gem 'awesome_print'
gem 'pry'
end
I tried the following ways to solve this problem.
brew link openssql --force
Warning: Refusing to link macOS provided/shadowed software: openssl#1.1
If you need to have openssl#1.1 first in your PATH, run:
echo 'export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"' >> /Users/userName/.bash_profile
For compilers to find openssl#1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
For pkg-config to find openssl#1.1 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig"
.base_profile
#..
export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig"
but result are the same
gem install eventmachine -- --with-cppflags=-I/usr/local/opt/openssl/include
gem install eventmachine --pre
bundle update eventmachine
add "gem 'eventmachine', '=1.0.3'" at Gemfile
change "gem 'eventmachine', '=1.0.4'" at Gemfile
change "gem 'eventmachine', '~>1.0.4'" at Gemfile
How can I solve this problem?
I work for
Mac Catalina 10.15.6
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
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?
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.
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.