mysql2 error - Gem::Ext::BuildError: ERROR: Failed to build gem native extension - ruby

Getting the following stack trace when installing mysql2 gem.
This problem wasn't observed until I updated the image this plan was working off, and I can see that one of the packages 'mysql-commercial-libs-compat' is not available.
I am using ruby v 2.7.6.
Would this package have anything to do with the following error:
Fetching mysql2 0.5.5
Installing mysql2 0.5.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/mysql2-0.5.5/ext/mysql2
/home/jenkins/.rbenv/versions/2.7.6/bin/ruby -I
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0 -r
./siteconf20230213-490-d7nyke.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_gc_mark_movable()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enc_interned_str() in ruby.h... no
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... no
checking for MYSQL_OPT_SSL_VERIFY_SERVER_CERT in mysql.h... yes
checking for MYSQL_OPT_SSL_ENFORCE in mysql.h... no
checking for MYSQL.net.vio in mysql.h... yes
checking for MYSQL.net.pvio in mysql.h... no
checking for MYSQL_DEFAULT_AUTH in mysql.h... yes
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes
checking for my_bool in mysql.h... yes
-----
Setting libpath to /usr/lib64
-----
creating Makefile
current directory:
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/mysql2-0.5.5/ext/mysql2
make "DESTDIR=" clean
current directory:
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/mysql2-0.5.5/ext/mysql2
make "DESTDIR="
compiling client.c
compiling infile.c
compiling mysql2_ext.c
compiling result.c
compiling statement.c
linking shared-object mysql2/mysql2.so
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
make: *** [mysql2.so] Error 1
make failed, exit code 2
Gem files will remain installed in
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/mysql2-0.5.5 for
inspection.
Results logged to
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0-static/mysql2-0.5.5/gem_make.out
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:99:in
`run'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:51:in
`block in make'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:43:in
`each'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:43:in
`make'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:63:in
`block in build'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/tempfile.rb:291:in `open'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:30:in
`build'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:169:in
`block in build_extension'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in
`synchronize'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in
`build_extension'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:210:in
`block in build_extensions'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in
`each'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in
`build_extensions'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/installer.rb:844:in
`build_extensions'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/source/rubygems.rb:204:in
`install'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/installer/gem_installer.rb:54:in
`install'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/installer/parallel_installer.rb:186:in
`do_install'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/worker.rb:62:in
`apply_func'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/worker.rb:57:in
`block in process_queue'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/worker.rb:54:in
`loop'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/worker.rb:54:in
`process_queue'
/home/jenkins/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.10/lib/bundler/worker.rb:91:in
`block (2 levels) in create_threads'
An error occurred while installing mysql2 (0.5.5), and Bundler cannot continue.
In Gemfile:
mysql2

Related

When trying to run bundle install I keep getting the error An error occurred while installing puma (5.6.4), and Bundler cannot continue MacOS 13.1

Every time I go to run bundle install
I keep getting stuck at installing puma, I have tried to manually install it using
gem install puma -v '5.6.4' -- --with-ldflags=-L/usr/local/opt/openssl#1.1/lib --with-cppflags=-I/usr/local/opt/openssl#1.1/include --with-cflags="-Wno-error=implicit-function-declaration"
to no avail, I did get
gem install puma -v '4.3.0' -- --with-ldflags=-L/usr/local/opt/openssl#1.1/lib --with-cppflags=-I/usr/local/opt/openssl#1.1/include --with-cflags="-Wno-error=implicit-function-declaration"
to work successfully but thats about the only puma version I have been able to get running.
Below is an output from a bundle install
Installing haml-rails 2.1.0 (was 2.0.1)
Installing premailer-rails 1.12.0 (was 1.11.1)
Installing devise_saml_authenticatable 1.9.1 (was 1.9.0)
Installing fog-aws 3.15.0 (was 3.14.0)
Using site_prism 3.7.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4/ext/puma_http11
/Users/user/.rvm/rubies/ruby-2.7.5/bin/ruby -I /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0 -r ./siteconf20230113-31731-rzw4du.rb extconf.rb
--with-cflags\=-Wno-error\=implicit-function-declaration
checking for BIO_read() in -llibcrypto... no
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
checking for DTLS_method() in openssl/ssl.h... no
checking for SSL_CTX_set_session_cache_mode(NULL, 0) in openssl/ssl.h... yes
checking for TLS_server_method() in openssl/ssl.h... no
checking for SSL_CTX_set_min_proto_version(NULL, 0) in openssl/ssl.h... no
checking for X509_STORE_up_ref()... no
checking for SSL_CTX_set_ecdh_auto(NULL, 0) in openssl/ssl.h... no
checking for SSL_CTX_set_dh_auto(NULL, 0) in openssl/ssl.h... no
checking for SSL_get1_peer_certificate() in openssl/ssl.h... no
checking for Random.bytes... yes
creating Makefile
current directory: /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4/ext/puma_http11
make "DESTDIR=" clean
current directory: /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
compiling mini_ssl.c
mini_ssl.c:301:32: warning: implicit declaration of function 'SSL_CTX_get0_param' is invalid in C99 [-Wimplicit-function-declaration]
X509_VERIFY_PARAM *param = SSL_CTX_get0_param(ctx);
^
mini_ssl.c:301:24: warning: incompatible integer to pointer conversion initializing 'X509_VERIFY_PARAM *' (aka 'struct X509_VERIFY_PARAM_st *') with an expression of
type 'int' [-Wint-conversion]
X509_VERIFY_PARAM *param = SSL_CTX_get0_param(ctx);
^ ~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
compiling puma_http11.c
linking shared-object puma/puma_http11.bundle
Undefined symbols for architecture x86_64:
"_SSL_CTX_get0_param", referenced from:
_sslctx_initialize in mini_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [puma_http11.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.7.5/extensions/x86_64-darwin-22/2.7.0/puma-5.6.4/gem_make.out
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:99:in `run'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:51:in `block in make'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:43:in `each'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:43:in `make'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:63:in `block in build'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/tempfile.rb:291:in `open'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:30:in `build'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:169:in `block in build_extension'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `synchronize'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `build_extension'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:210:in `block in build_extensions'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `each'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `build_extensions'
/Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/installer.rb:844:in `build_extensions'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/rubygems_gem_installer.rb:28:in `install'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/source/rubygems.rb:204:in `install'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/gem_installer.rb:54:in `install'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:62:in `apply_func'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:57:in `block in process_queue'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:54:in `loop'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:54:in `process_queue'
/Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'
An error occurred while installing puma (5.6.4), and Bundler cannot continue.
In Gemfile:
puma
❯ uname -m
x86_64
I am on a M1 Pro MacBook Pro but I am running my terminal in Rosetta.
I have tried reinstalling Puma from scratch using
gem install puma -v '4.3.0' -- --with-ldflags=-L/usr/local/opt/openssl#1.1/lib --with-cppflags=-I/usr/local/opt/openssl#1.1/include --with-cflags="-Wno-error=implicit-function-declaration"
I have completely uninstall homebrew and reinstalled it under Rosetta since that is what was suggested to be done at work but still to no avail.

Installing ruby-debug-ide - Failed to build gem native extension

I have win7x64 and struggling to install ruby-debug-ide to use debugger in my ide. It is failing to build gem native extensions
have tried everything i could find through net
--verbose, --pre, --with ruby etc
Its still failing (
Can anyone give some tip please? thanks
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
$ gem install ruby-debug-ide
Building native extensions. This could take a while...
System cannot find path specified
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0/ext
C:/Ruby231-x64/bin/ruby.exe mkrf_conf.rb
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
Installing base gem
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9/ext
C:/Ruby231-x64/bin/ruby.exe -r ./siteconf20170120-10104-1f4a8us.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby231-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9 for inspection.
Results logged to C:/Ruby231-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/gem_make.out
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:92:in `run'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:48:in `block in build'
C:/Ruby231-x64/lib/ruby/2.3.0/tempfile.rb:295:in `open'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:31:in `build'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:164:in `block (2 levels) in build_extension'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:163:in `chdir'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:163:in `block in build_extension'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `synchronize'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `build_extension'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:201:in `block in build_extensions'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:198:in `each'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:198:in `build_extensions'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:752:in `build_extensions'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:304:in `install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/resolver/specification.rb:97:in `install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:166:in `block in install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:156:in `each'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:156:in `install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/dependency_installer.rb:405:in `install'
mkrf_conf.rb:35:in `rescue in <main>'
mkrf_conf.rb:28:in `<main>'
rake failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0 for inspection.
Results logged to C:/Ruby231-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/ruby-debug-ide-0.6.0/gem_make.out
$ gem install debase-ruby_core_source
Successfully installed debase-ruby_core_source-0.9.6
$ gem install debase -- --with-ruby-include=C:\Ruby231-x64\lib\ruby\gems\2.3.0\gems\debase-ruby_core_source-0.9.6\lib\debase\ruby_core_source\ruby-2.3.1-p112
Building native extensions with: '--with-ruby-include=C:\Ruby231-x64\lib\ruby\gems\2.3.0\gems\debase-ruby_core_source-0.9.6\lib\debase\ruby_core_source\ruby-2.3.1-p112ruby -v'
This could take a while...
System cannot find path specified
ERROR: Error installing debase:
ERROR: Failed to build gem native extension.
$ gem install debase --pre
Building native extensions. This could take a while...
System cannot find path specified
ERROR: Error installing debase:
ERROR: Failed to build gem native extension.
$ gem install ruby-debug-ide --pre
Building native extensions. This could take a while...
Системе не удается найти указанный путь.
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.1.beta4/ext
C:/Ruby231-x64_unit/bin/ruby.exe mkrf_conf.rb
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
Installing base gem
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9/ext
C:/Ruby231-x64_unit/bin/ruby.exe -r ./siteconf20170201-7760-7dws4t.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9 for inspection.
Results logged to C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/gem_make.out
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:91:in `run'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:36:in `block in build'
C:/Ruby231-x64_unit/lib/ruby/2.3.0/tempfile.rb:295:in `open'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:19:in `build'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:163:in `block (2 levels) in build_extension'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `chdir'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `block in build_extension'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:161:in `synchronize'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:161:in `build_extension'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:200:in `block in build_extensions'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:197:in `each'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:197:in `build_extensions'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:741:in `build_extensions'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:290:in `install'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:166:in `block in install'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:150:in `each'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:150:in `install'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/dependency_installer.rb:404:in `install'
mkrf_conf.rb:35:in `rescue in <main>'
mkrf_conf.rb:28:in `<main>'
rake failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.1.beta4 for inspection.
Results logged to C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/ruby-debug-ide-0.6.1.beta4/gem_make.out

Problems installing zeromq MacOSX

I tried to install zeromq using brew on MacOSX 10.9.5. This is the output I got:
==> Downloading http://download.zeromq.org/zeromq-3.2.3.tar.gz
######################################################################## 100.0%
==> Patching
patching file tests/test_disconnect_inproc.cpp
==> ./configure --prefix=/usr/local/Cellar/zeromq/3.2.3
==> make
==> make install
==> Caveats
To install the zmq gem on 10.6 with the system Ruby on a 64-bit machine,
you may need to do:
ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq
==> Summary
/usr/local/Cellar/zeromq/3.2.3: 54 files, 2.3M, built in 24 seconds
And after trying to execute the command it tells me to run (ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq), it tells me that it couldn't install zmq:
Fetching: zmq-2.1.4.gem (100%)
Building native extensions with: '--with-zmq-dir=/usr/local/opt/zeromq'
This could take a while...
ERROR: Error installing zmq:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-zmq-dir=/usr/local/opt/zeromq
checking for zmq.h... /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
from extconf.rb:23:in `header?'
from extconf.rb:32:in `<main>'
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/zmq-2.1.4 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/zmq-2.1.4/./gem_make.out
Does someone know what problem that is and how to resolve it?
I had a similar problem on Yosemite. I've installed zmg using port:
sudo port install zmg
followed by:
npm install zmq
and:
brew uninstall zmq

Installing gems with extensions always fails

I just setup an Ubuntu 13.04 server, and installed RVM 1.21.11, Ruby 1.9.3-p448, and Rubygems 2.0.5 .
Many gems, such as mongo, awesome_print, aws-s3, and json, installed successfully.
However, gems that compile an extension fail. I've tried to install nokogiri, mongo_ext, and bson_ext . They all fail in the same way, as shown below.
Any idea how to fix this?
[nick#mongo01 ~] gem install mongo_ext -u -V --backtrace
HEAD http://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD http://production.s3.rubygems.org/latest_specs.4.8.gz
304 Not Modified
Installing gem mongo_ext-0.19.3
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/Rakefile
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/mongo-extensions.gemspec
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/extconf.rb
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/buffer.c
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/cbson.c
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/encoding_helpers.c
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/buffer.h
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/encoding_helpers.h
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/version.h
Building native extensions. This could take a while...
/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for asprintf()... yes
checking for ruby/st.h... yes
checking for ruby/regex.h... yes
checking for ruby/encoding.h... yes
creating Makefile
make "DESTDIR="
compiling encoding_helpers.c
compiling buffer.c
compiling cbson.c
cbson.c: In function 'write_utf8':
cbson.c:80:36: warning: pointer targets in passing argument 1 of 'check_string' differ in signedness [-Wpointer-sign]
In file included from cbson.c:46:0:
encoding_helpers.h:26:10: note: expected 'const unsigned char *' but argument is of type 'char *'
cbson.c: In function 'objectid_generate':
cbson.c:858:5: warning: implicit declaration of function 'htonl' [-Wimplicit-function-declaration]
cbson.c:867:5: warning: implicit declaration of function 'htons' [-Wimplicit-function-declaration]
cbson.c: In function 'write_element':
cbson.c:264:17: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
linking shared-object mongo_ext/cbson.so
make "DESTDIR=" install
/usr/bin/install -c -m 0755 cbson.so /usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/.gem.20130718-9545-1ue92ws/mongo_ext
installing default cbson libraries
ERROR: While executing gem ... (NoMethodError)
undefined method `join' for nil:NilClass
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:685:in `rescue in block in build_extensions'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:675:in `block in build_extensions'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:653:in `each'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:653:in `build_extensions'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:218:in `install'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:371:in `block in install'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:331:in `each'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:331:in `each_with_index'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:331:in `install'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:166:in `block in execute'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:158:in `each'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:158:in `execute'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:305:in `invoke_with_build_args'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:170:in `process_args'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:130:in `run'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:60:in `run'
/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/gem:21:in `<main>'
[nick#mongo01 ~]
[nick#mongo01 ~] gem -v
2.0.5
[nick#mongo01 ~] ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
[nick#mongo01 ~] rvm -v
rvm 1.21.11 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
This is often because the native extension needs to be compiled on your system, and you don't have the proper development tools installed. Have you done this?
yum groupinstall 'Development Tools'
Perhaps one of these tools is the wrong version, or otherwise hosed?
This was caused by a bug in RubyGems. It was fixed in 8d1751c6.
Until RubyGems v2.0.6 is released, a workaround is to apply 8d1751c6 manually.

rake and utf-8 char in appication path

I use an application which I compile using rake. The problem is if I set my application directory in a path containing non US-ASCII char, the compilation fails.
For exemple:
cd /home/user/Downloads/my_app
rake
==> it works
cd /home/user/Téléchargements/my_app
rake
==> it doesn't work
My system is full utf-8
How can I avoid this?
For information the application that I try to compile is subtle :
hg clone http://hg.subforge.org/subtle
cd subtle
rake
Here the full error message:
** Invoke default (first_time)
** Invoke config (first_time)
** Execute config
checking for stdio.h... yes
checking for stdlib.h... yes
checking for stdarg.h... yes
checking for string.h... yes
checking for unistd.h... yes
checking for signal.h... yes
checking for errno.h... yes
checking for assert.h... yes
checking for sys/time.h... yes
checking for sys/types.h... yes
checking for sys/inotify.h... yes
checking for wordexp.h... yes
rake aborted!
invalid byte sequence in US-ASCII
/usr/lib/ruby/1.9.1/mkmf.rb:785:in `[]'
/usr/lib/ruby/1.9.1/mkmf.rb:785:in `checking_for'
/home/silkmoth/Téléchargements/subtle/Rakefile:335:in `block in <top (required)>'
/usr/lib/ruby/1.9.1/rake/task.rb:205:in `call'
/usr/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
/usr/lib/ruby/1.9.1/rake/task.rb:200:in `each'
/usr/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
/usr/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'
/usr/lib/ruby/1.9.1/rake/task.rb:174:in `each'
/usr/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'
/usr/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
/usr/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
/usr/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/lib/ruby/1.9.1/rake/application.rb:94:in `each'
/usr/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
/usr/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
/usr/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
/usr/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/1.9.1/rake/application.rb:63:in `run'
/usr/bin/rake:32:in `<main>'
Tasks: TOP => default => config
The problem is not the encoding of the files, but the non-ascii symbols in your path ('Téléchargements').
Apparently, the exception happens in #checking_for from mkmf on line 785 in combination with rake. As author of the Rakefile, there is nothing I can do about that, besides reporting that upstream and/or find a way to avoid the method at all.
Quick fix is use a path without non-ascii symbols, sorry.

Resources