I use homebrew to install the fox library successfully.
When I try sudo gem install fxruby, it fails.
The error message is shown below.
Building native extensions. This could take a while...
ERROR: Error installing fxruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for sys/time.h... yes
checking for signal.h... yes
checking for deflate() in -lz... yes
checking for png_create_read_struct() in -lpng... yes
checking for jpeg_mem_init() in -ljpeg... no
checking for TIFFSetErrorHandler() in -ltiff... no
checking for XftInit() in -lXft... yes
checking for XShmQueryVersion() in -lXext... yes
checking for XFindContext() in -lX11... yes
checking for glXCreateContext() in -lGL... yes
checking for gluNewQuadric() in -lGLU... yes
checking for FXRbCommon.h in ./include... no
creating Makefile
make "DESTDIR="
compiling librb.c
compiling core_wrap.cpp
core_wrap.cpp:593:10: fatal error: 'FXRbCommon.h' file not found
#include "FXRbCommon.h"
^
1 error generated.
make: *** [core_wrap.o] Error 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/fxruby-1.6.28 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/fxruby-1.6.28/ext/fox16_c/gem_make.out
I had the exact same problem (Mac 10.9.3) and followed the advice on https://github.com/larskanis/fxruby/issues/7 (actually reference a Debian installation)
This was basically to try sudo gem install fxruby -- --with-cppflags=-I./include
Worked for me
Hope it helps.
Related
Helle everyone,
I am trying to install the eventmachine gem in a project after it fails during a bundle install.
gem install eventmachine -v '1.0.5'
Logs:
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/Users/studiohb/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... 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 rb_thread_fd_select()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for clock_gettime()... no
checking for gethrtime()... no
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling binder.cpp
In file included from binder.cpp:20:
./project.h:116:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
1 error generated.
make: *** [binder.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/studiohb/.rvm/gems/ruby-2.1.2#regiex/gems/eventmachine-1.0.5 for inspection.
Results logged to /Users/studiohb/.rvm/gems/ruby-2.1.2#regiex/extensions/x86_64-darwin-13/2.1.0-static/eventmachine-1.0.5/gem_make.out
So I believe that this is a SSL certificat issue si I tried :
brew link --force openssl
logs :
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
Do you guys have any ideas on going around this error ?
I've looked at and tried just about everything on the topic here at Stackoverflow.com and still can't figure this out...
When I 'gem install mysql2' I get a permissions error. when I 'sudo gem install mysql2' I get the following:
Teds-MacBook-Pro:~ tedmartin$ sudo gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
current directory: /Users/tedmartin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.5/ext/mysql2
/Users/tedmartin/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20170420-50202-1nekuvd.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for rb_big_cmp()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in mysql.h... yes
checking for SSL_MODE_VERIFY_CA in mysql.h... yes
checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /usr/local/Cellar/mysql-connector-c/6.1.9/lib
-----
creating Makefile
current directory: /Users/tedmartin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.5/ext/mysql2
make "DESTDIR=" clean
current directory: /Users/tedmartin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.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.bundle
ld: library not found for -l-lpthread
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/tedmartin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.5 for inspection.
Results logged to /Users/tedmartin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-15/2.4.0-static/mysql2-0.4.5/gem_make.out
Anyone who has an idea, suggestion, tip, fix, etc... I'd be really grateful.
Thanks!
From the answer at this question, running the following worked for me
gem install mysql2 --source 'https://rubygems.org/' -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include
I ran into this same issue on Mojave, and none of the previous answers worked for me but this commands mentioned in this Github issue comment did
Step 1.
brew install openssl
Step 2.
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
In my case I already had openssl installed so it was really the export command that solved the problem.
Make sure openssl is installed on Mac via Homebrew.
brew install openssl
Install mysql2 gem.
gem install mysql2 -v '0.5.2' -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include
If the bug is not fixed, this above solution is the last one
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
Another solution if the above does not work.
cd /usr/local/Cellar/openssl/1.0.2s/lib/
sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/local/lib
This worked for me on macOS Catalina:
Make sure you have openssl installed. If not:
brew install openssl
Then do the gem install:
gem install mysql2 -- --with-opt-dir="$(brew --prefix openssl)"
Try this:
which mysql
Then, use the output-result to install the gem using the existing mysql installation directory:
gem install mysql2 -- --with-mysql-dir=<mysql-installation-directory>
It away working for me after 2h crazy
Unstall Ruby and Install Ruby v2.6.6
Run command line as Administrator gem install mysql2
Install rails gem install rails
Create new project rails new my_proj -d mysql
Work 100% in Windown
I have gone through a lot of answers on a similar questions but I have not been successful. I am trying to install therubyracer 0.12.3 on my MAC OSX 10.12.4 and I am receiving the following error. Please help. Been stuck with this for two days now.
sudo gem install therubyracer -v '0.12.3'
Building native extensions.
This could take a while... ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
/Users/aj035785/.rvm/rubies/ruby-2.3.1/bin/ruby -r
./siteconf20170420-2619-13h8man.rb extconf.rb checking for main() in
-lpthread... yes checking for main() in -lobjc... yes creating Makefile
current directory:
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR=" clean
current directory:
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR=" compiling accessor.cc make:
/usr/local/opt/apple-gcc42/bin/g++-4.2: No such file or directory
make: *** [accessor.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3
for inspection. Results logged to
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0/therubyracer-0.12.3/gem_make.out
Blockquote
I feel this might be the root cause -
make: /usr/local/opt/apple-gcc42/bin/g++-4.2: No such file or directory
In trying to install the nio4r gem. I tried
gem install nio4r -v '1.0.0'
The error that pops up is:
Building native extensions. This could take a while...
ERROR: Error installing nio4r:
ERROR: Failed to build gem native extension.
/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150406-11564-1qtifmf.rb extconf.rb
checking for rb_thread_blocking_region()... no
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for port.h... no
checking for sys/resource.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling monitor.c
In file included from monitor.c:6:
In file included from ./nio4r.h:10:
/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/backward/rubyio.h:2:2: warning: use "ruby/io.h" instead of "rubyio.h" [-W#warnings]
warning use "ruby/io.h" instead of "rubyio.h"
...
What am I getting wrong? Is it an issue with my RVM?
With some basic updates, I was able to get it to work.
bundle update
and then
bundle
installs the gem.
Thanks to https://github.com/celluloid/nio4r/issues/46
Another approach would be to install a later version of ruby with RVM and do bundle again. Both works
Please help me to install capybara gem in Windows.
>gem install capybara
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing capybara:
ERROR: Failed to build gem native extension.
C:/Ruby193/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 ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile
make
generating ffi_c-i386-mingw32.def
Configuring libffi
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/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"
make[1]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32'
Makefile:318: *** missing separator. Stop.
make[1]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32'
make: *** ["/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"/.libs/libffi_convenience.a] Error 2
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/gem_make.out
I already have downloaded and installed some 1,7 GB "QT" thing as my colleagues advised, with no effect.
Update:
>gem install ffi
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
C:/Ruby193/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 ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile
make
generating ffi_c-i386-mingw32.def
Configuring libffi
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/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"
make[1]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-min
gw32'
Makefile:318: *** missing separator. Stop.
make[1]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-ming
w32'
make: *** ["/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"/.libs/libff
i_convenience.a] Error 2
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/gem_make.out
I've ran capybara tests on a windows xp machine before. You probably need the devkit: http://rubyinstaller.org/downloads/
It is probably better to work with the RailsInstaller instead, it will save you from a lot of pitfalls trying to sort out dependencies other than the RubyInstaller itself.