Trying to run ruby on rails framework under nginx+thin, currently working under WEBrick.
I don't have root access, cause it is hosted at web hosting service.
Till this moment all problems with gems solved w/o root access.
thin requires eventmachine, so:
$ gem install eventmachine
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby18 extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... no
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_check_ints()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
creating Makefile
make
<cutted non-informative output>
make install
/usr/bin/install -c -o root -g wheel -m 0755 rubyeventmachine.so /www/<hostname>/.gems/gems/eventmachine-0.12.10/lib
install: /www/<hostname>/.gems/gems/eventmachine-0.12.10/lib/rubyeventmachine.so: chown/chgrp: Operation not permitted
*** Error code 71
Stop in /www/<hostname>/.gems/gems/eventmachine-0.12.10/ext.
Gem files will remain installed in /www/<hostname>/.gems/gems/eventmachine-0.12.10 for inspection.
Results logged to /www/<hostname>/.gems/gems/eventmachine-0.12.10/ext/gem_make.out
Versions of ruby and installed gems:
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-freebsd8]
$ gem list
activesupport (3.0.9)
backports (2.2.1)
bin (0.6.3)
bson (1.3.1)
i18n (0.4.2)
mongo (1.0.9)
rack (1.1.1)
rake (0.8.7)
rake-compiler (0.7.9)
ruby-augeas (0.3.0)
rubygems-update (1.8.5)
sources (0.0.2)
specific_install (0.2.3)
yard (0.7.2)
I didn't really figured out, is the problem in ERROR: Failed to build gem native extension. or in make install ***Error code 71.
Same thing happens trying $ gem install thin
The error is ERROR: Failed to build gem native extension.. Usually it means something is missing in your system. Ruby development libraries or a dependency of the gem. In this particular case i think libevent (its a dependency of eventmachine) is not in your system.
You will find a complete description of what went wrong at:
/www/<hostname>/.gems/gems/eventmachine-0.12.10/ext/gem_make.out
Thanks for advice, Pablo!
Unfortunately, gem_make.out contained only information I provided, nothing else...
Due to rubyforge bugtracker aboud freebsd, I realised that adding this line to .bashrc solves the problem
export RB_USER_INSTALL="$USER"
After source .bashrc I successfully installed both eventmachine and thin.
Related
Can't install specific ffi version. If I run gem install ffi, everything works just fine but I need specific version 1.9.18 and it doesn't work.
Fetching ffi 1.9.18
Installing ffi 1.9.18 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-
1.9.18/ext/ffi_c
/Users/chille/.rbenv/versions/2.6.5/bin/ruby -I
/Users/chille/.rbenv/versions/2.6.5/lib/ruby/2.6.0 -r
./siteconf20200928-22154-72wopi.rb extconf.rb
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
checking for shlwapi.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... yes
creating extconf.h
creating Makefile
current directory: /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-
1.9.18/ext/ffi_c
make "DESTDIR=" clean
current directory: /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-
1.9.18/ext/ffi_c
make "DESTDIR="
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
Call.c:355:5: error: implicit declaration of function 'rb_thread_call_without_gvl' is
invalid in C99
[-Werror,-Wimplicit-function-declaration]
rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
^
./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region'
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
^
1 error generated.
make: *** [Call.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.9.18 for inspection.
Results logged to /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-
darwin-19/2.6.0/ffi-1.9.18/gem_make.out
An error occurred while installing ffi (1.9.18), and Bundler cannot continue.
Make sure that gem install ffi -v '1.9.18' succeeds before bundling.
In Gemfile:
bootstrap-sass was resolved to 3.3.7, which depends on
sass was resolved to 3.5.5, which depends on
sass-listen was resolved to 4.0.0, which depends on
rb-inotify was resolved to 0.9.10, which depends on
ffi
To get past that error, install ffi using:
gem install ffi -v '1.9.18' -- --with-cflags="-Wno-error=implicit-function-declaration"
if you want bundle install ffi 1.9.8
bundle config --local build.ffi --with-cflags=-Wno-error=implicit-function-declaration
bundle install
For those who can, I think bumping ffi version should be preferred here. bundle update ffi took me from from 1.9.18 to 1.13.1 and built successfully for me.
#denis-osmerovic, unless you have another dependency holding ffi back, you should also be able to bump ffi. Checking my dependency chain, my ffi dependency is also coming from rb-inotify 0.9.10, same as yours. The listed requirement is for ffi (>= 0.5.0, < 2), so 1.13.1 should be acceptable.
Other background:
I previously had a working copy of ffi 1.19.18, and I don't remember needing to pass any special build flags. In order to reproduce this I uninstalled and tried to reinstall that version. I'm guessing other library or toolchain updates in the meantime broke this.
I am running ruby 2.6.3 on OS X 10.15.7 alongside Xcode 12.0.1
On an M1 Catalina 11.6, I was able to get past the error by first doing:
bundle update ffi
Then because I did not care about which version:
gem install ffi -- --with-cflags="-Wno-error=implicit-function-declaration"
If you need a version, other answers have that.
Due to the very nature of what the ffi gem does, it is tightly bound to the internals of the YARV engine. Therefore, you need to make sure you use a version of YARV that matches the version of the ffi gem.
In 2017, that would have been Ruby 2.4. Note that as of April 2020, Ruby 2.4 is no longer supported.
ffi gem 1.9.21 installed successfully.
I also tried to run these commands but no success.
sudo apt install libffi-dev
gem inst ffi
This error occurs when I deploy to AWS. The error looks like this.
Installing dotenv 2.2.1
Installing request_store 1.3.2
Installing draper 3.0.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/opt/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20180207-2245-1bjhja4.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
Running autoreconf for libffi
/var/app/ondeck/vendor/bundle/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: line 2: exec: autoreconf: not found
make: *** ["/var/app/ondeck/vendor/bundle/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux"/.libs/libffi_convenience.a] Error 127
make failed, exit code 2
Gem files will remain installed in /var/app/ondeck/vendor/bundle/gems/ffi-1.9.21 for inspection.
Results logged to /var/app/ondeck/vendor/bundle/extensions/x86_64-linux/2.2.0-static/ffi-1.9.21/gem_make.out
An error occurred while installing ffi (1.9.21), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.21'` succeeds before bundling. (Executor::NonZeroExitStatus)
Any help will be much appriciated. thanks in advance.
Seems like this issue is due to the ffi latest version, I specified the ffi oldest version in Gemfile gem 'ffi', '1.9.18' run bundle install in the console, it fixed my issue.
As stated in a comment on a relevant issue, the workaround is:
sudo apt install libffi-dev
Do this in your server
sudo apt-get install ruby-dev
Ref: Registered issue
Please let me know If this not worked.
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable 2.3.6
Using chunky_png 1.3.1
Using fssm 0.2.10
Using sass 3.2.19
Using compass 0.12.7
Using breakpoint 2.0.7
Using timers 1.1.0
Using celluloid 0.15.2
Using coderay 1.1.0
Using compass-blend-modes 0.0.2
Using color-schemer 0.2.8
Using compass-normalize 1.5
Using compass-rgbapng 0.2.1
Using compass-validator 3.0.1
Using css_parser 1.3.5
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/Zach/.rvm/rubies/ruby-1.9.3-p547/bin/ruby.exe extconf.rb
checking for main() in -lssl... yes
checking for main() in -lcrypto... 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()... 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_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... yes
checking for rb_time_new()... yes
checking for sys/event.h... no
creating Makefile
make clean
make
compiling binder.cpp
make: g++: Command not found
Makefile:198: recipe for target 'binder.o' failed
make: *** [binder.o] Error 127
make failed, exit code 2
Gem files will remain installed in /home/Zach/.rvm/gems/ruby-1.9.3-p547/gems/eventmachine-1.0.3 for inspection.
Results logged to /home/Zach/.rvm/gems/ruby-1.9.3-p547/extensions/x86_64-cygwin/1.9.1/eventmachine-1.0.3/gem_make.out
An error occurred while installing eventmachine (1.0.3), and Bundler cannot
continue.
Make sure that `gem install eventmachine -v '1.0.3'` succeeds before bundling.
I'm trying to install the missing gems necesary so I can use drush omega-guard
There was a problem with your setup: [error]
Resolving dependencies...
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
But I get the error with eventmachine, how can I fix this? I tried changing the version of ruby to see if it works, but i just ran into some other errors.
Apparently you don't have a C++ compiler. If you're using Ubuntu try sudo apt-get install g++.
I'm trying to install an old version of nokogiri, but I am having trouble specifying the format:
I'm using
gem install nokogiri -v 1.5.2 -- --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
but this is not the correct syntax. Do you know how to do this?
ERROR
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/boris/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
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... no
checking for iconv_open() in -liconv... no
-----
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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.
Provided configuration options:
You’ve only specified the lib dir to use, try specifying the include dir as well:
gem install nokogiri -v 1.5.2 -- \
--with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib \
--with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include
You may be able to specify both together:
gem install nokogiri -v 1.5.2 -- \
--with-iconv-dir=/usr/local/Cellar/libiconv/1.13.1
It looks like there was some changes as to how Nokogiri finds iconv between versions 1.5.2 and 1.5.5, which may explain why you’re able to install the latest version but not 1.5.2.
I simply installed homebrew, and used the brew link inconv to create the necessary symlinks to compile the gem.
$brew link libiconv
Linking /usr/local/Cellar/libiconv/1.13.1... 18 symlinks created
$gem install nokogiri -v 1.5.2
I'm trying to upgrade my Redmine installation to the latest.
I updated ruby, rails, and gem as required.
current trunk | ruby 1.8.7, 1.9.2, 1.9.3, jruby-1.6.7 | Rails 3.2.6 | RubyGems <= 1.8
Issuing the rake db:migrate command it gives me the following error:
C:\ruby-apps\RedMine>rake db:migrate RAILS_ENV=production
←[31mCould not find gem 'rmagick (>= 2.0.0) x86-mingw32' in the gems available on this machine.←[0m
←[33mRun bundle install to install missing gems.←[0m
So I installed rmagick for win32 and listing installed gems I see :
...
railties (3.2.6)
rake (0.9.2.2)
rdoc (3.12)
rmagick (2.12.0 mswin32)
ruby-openid (2.1.8)
rubygems-update (1.8.24)
...
But rake db:migrate still give me the same error, so I tried bundle install, but I get:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... * 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.
Any ideas on how to get out of this?
I ran into the same problem while installing redmine. According to a comment in the Gemfile rmagick optional and only used to export Gant graphs as PNGs. So if you do not need this specific feature you can run
bundle install --without development test rmagick
Actually Bitnami's Redmine windows Installer contains a solution to this problem.
Using it, for me is a valid solution to the problem.
The content of the installation may be used to inspect correct versions and dependencies to correctly build Redmine.