Nokogiri can't install native extensions issue - ruby-on-rails

When trying to install nokogiri, I get:
± gem install nokogiri -v '1.6.0'
Building native extensions. This could take a while...
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
/Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/mini_portile-0.5.0/lib/mini_portile.rb:199: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin11.4.0/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-apple-darwin11.4.0/ports/libxml2/2.8.0/configure.log' to see what happened.
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/Chintan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
/Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/mini_portile-0.5.0/lib/mini_portile.rb:235:in `block in execute': Failed to complete configure task (RuntimeError)
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/mini_portile-0.5.0/lib/mini_portile.rb:227:in `chdir'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/mini_portile-0.5.0/lib/mini_portile.rb:227:in `execute'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/mini_portile-0.5.0/lib/mini_portile.rb:57:in `configure'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/mini_portile-0.5.0/lib/mini_portile.rb:100:in `cook'
from extconf.rb:101:in `block in <main>'
from extconf.rb:119:in `call'
from extconf.rb:119:in `block in <main>'
from extconf.rb:109:in `tap'
from extconf.rb:109:in `<main>'
Gem files will remain installed in /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/nokogiri-1.6.0 for inspection.
Results logged to /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
Looks like the issue is with the C compiler, here's the contents of configure.log:
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/nokogiri-1.6.0/ext/nokogiri/tmp/x86_64-apple-darwin11.4.0/ports/libxml2/2.8.0/libxml2-2.8.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
Update:
Re-installing my compiler lets me install nokogiri, but I can't start rails server:
/Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore-Q16.7.dylib (LoadError)
Referenced from: /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rmagick-2.13.2/lib/RMagick2.bundle
Reason: image not found - /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rmagick-2.13.2/lib/RMagick2.bundle
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rmagick-2.13.2/lib/RMagick.rb:11:in `<top (required)>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/Chintan/Documents/Work/Aidin/config/initializers/imagemagick.rb:1:in `<top (required)>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:50:in `load'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:50:in `load'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/zeus-0.13.3/lib/zeus/load_tracking.rb:43:in `load'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/engine.rb:587:in `each'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/engine.rb:587:in `block in <class:Engine>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/Chintan/Documents/Work/Aidin/config/environment.rb:5:in `<top (required)>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/Chintan/Documents/Work/Aidin/config.ru:3:in `block in <main>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/Chintan/Documents/Work/Aidin/config.ru:in `new'
from /Users/Chintan/Documents/Work/Aidin/config.ru:in `<main>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/Chintan/.rvm/gems/ruby-1.9.3-p327#aidin_development/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Last time I had this issue, the fix was to just re-install apple-gcc42, but that that doesn't seem to be the issue right now. Any ideas?

Looks like this issue has been already addressed: nokogiri will not install - ERROR: Failed to build gem native extension
Try
sudo apt-get install libxslt-dev libxml2-dev

You need libxslt and libxml2 to build nokogiri. And since you're on MacOS X, you need to install via MacPorts or Homebrew. For Homebrew, try:
brew install libxslt libxml2

homebrew 0.9
Apparently some people have had problems getting libiconv to install under homebrew 0.9 (see issue #442). Here’s what reportedly works:
brew install libxml2 libxslt
brew link libxml2 libxslt
Then install libiconv from source:
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
tar xvfz libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
make
sudo make install
Then (finally) install nokogiri:
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 \
--with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib \
--with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 \
--with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include \
--with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib

This workaround worked for me: https://github.com/opscode-cookbooks/xml/issues/19
1) Add liblzma-dev and z-lib1g-dev
sudo apt-get install liblzma-dev zlib1g-dev
2) Install using those
sudo /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.6.5" -- --use-system-libraries --with-xml2-include=/usr/include/libxml2

Following this worked for me http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/
It was a Mavericks issue involving developer tools.

A more comprehensive cases are detailed on nokogiri website
For me, on MacOs, it worked like as it is sugested here:
brew install libxml2
# If installing directly
gem install nokogiri -- --use-system-libraries \
--with-xml2-include=$(brew --prefix libxml2)/include/libxml2
# If using Bundle
bundle config build.nokogiri --use-system-libraries \
--with-xml2-include=$(brew --prefix libxml2)/include/libxml2
bundle install
When working with this, be certain to use $(brew --prefix libxml2)
because it will use the correct location for your Homebrew install.

Related

Image not found when running rails in Rubymine

I'm getting the following error when trying to run some rails commands in my Rubymine. I have recently changed some permissions to get some symlinks to work although this may not be related.
For example when I run rails c I get this type of error.
RAILS_GROUPS is unset; defaulting to web,worker
/Users/paul/.rvm/gems/ruby-2.4.1/gems/pg-0.20.0/lib/pg.rb:4:in `require': dlopen(/Users/paul/.rvm/gems/ruby-2.4.1/gems/pg-0.20.0/lib/pg_ext.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/opt/postgresql/lib/libpq.5.dylib
Reason: image not found - /Users/paul/.rvm/gems/ruby-2.4.1/gems/pg-0.20.0/lib/pg_ext.bundle (LoadError)
from /Users/paul/.rvm/gems/ruby-2.4.1/gems/pg-0.20.0/lib/pg.rb:4:in `<top (required)>'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `require'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `block (2 levels) in require'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `each'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `block in require'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `each'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `require'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler.rb:114:in `require'
from /Users/paul/labstat1/labstat1/config/application.rb:29:in `<top (required)>'
from /Users/paul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
from /MacBook-Pro:labstat1 paul$ Users/paul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
from /Users/paul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /Users/paul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /Users/paul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /Users/paul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /Users/paul/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/paul/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
It doesn't seem to be a Ruby On Rails/Rubymine issue but a MacOS one.
From https://github.com/kelaberetiv/TagUI/issues/86:
There is a new dependency in newer versions of macOS. To fix the error do the following. It installs Homebrew (a package manager for macOS) and installs OpenSSL for https connections.
If you do not have Homebrew or don't know what is Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update && brew upgrade
brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Or if you already have Homebrew installed
brew update && brew upgrade
brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

rails and ruby update on ubuntu ERROR: Failed to build gem native extension

I'm upgrading a RoR app on an Ubuntu 14.04 server (AWS EC2) from ruby 2.1.4 to 2.2.4 and rails 4.2.4 to 4.2.6, running the following commands after successfully sshing into the server:
git pull origin master
rvm install 2.2.4
bundle install
gem install rails 4.2.6
./restart_server.sh # script to precompile assets and restart the server
When accessing the end point, I receive the following response of Web application can not be started
ERROR: Failed to build gem native extension.
/home/ubuntu/.rvm/rubies/ruby-2.2.4/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... 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... no
checking for epoll_create() in sys/epoll.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling binder.cpp
compiling page.cpp
compiling cmain.cpp
compiling kb.cpp
compiling rubymain.cpp
compiling ed.cpp
compiling em.cpp
em.cpp: In member function 'void EventMachine_t::_RunEpollOnce()':
em.cpp:574:37: error: 'rb_thread_select' was not declared in this scope
em.cpp: In member function 'int SelectData_t::_Select()':
em.cpp:827:67: error: 'rb_thread_select' was not declared in this scope
em.cpp: In member function 'void EventMachine_t::_RunSelectOnce()':
em.cpp:946:40: error: 'rb_thread_select' was not declared in this scope
make: *** [em.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/ubuntu/.rvm/gems/ruby-2.1.0/gems/eventmachine-1.0.3 for inspection.
Results logged to /home/ubuntu/.rvm/gems/ruby-2.1.0/extensions/x86_64-linux/2.2.0/eventmachine-1.0.3/gem_make.out
(Gem::Ext::BuildError)
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:89:in `run'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:51:in `block in make'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:43:in `each'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:43:in `make'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/ext_conf_builder.rb:47:in `block in build'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/tempfile.rb:319:in `open'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:160:in `chdir'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:160:in `block in build_extension'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:159:in `synchronize'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:159:in `build_extension'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:195:in `each'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:195:in `build_extensions'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1436:in `block in build_extensions'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/user_interaction.rb:45:in `use_ui'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1434:in `build_extensions'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/stub_specification.rb:60:in `build_extensions'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:924:in `each'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:924:in `find'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:924:in `find_inactive_by_path'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems.rb:185:in `try_activate'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:144:in `require'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:360:in `load_native_extension'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:106:in `load_from_buildout_dir'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:36:in `try_load'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:47:in `start'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger/native_support.rb:376:in `<top (required)>'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/lib/phusion_passenger.rb:233:in `require_passenger_lib'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/helper-scripts/rack-preloader.rb:75:in `init_passenger'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/helper-scripts/rack-preloader.rb:157:in `<module:App>'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/home/ubuntu/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/helper-scripts/rack-preloader.rb:28:in `<main>'
The issue was caused from an ubuntu library dependency issue, resolved using the following commands:
sudo apt-get remove linux-headers-virtual linux-virtual
sudo apt-get install linux-headers-virtual linux-virtual
sudo apt-get -f install
sudo apt-get autoremove

rails console require cannot load such file readline

I am new to Ruby on Rails, and I install ruby by source.
Ruby version is 2.3.0 and rails version is Rails 4.2.5.
I can't run rails c or rails console.
It giving me the following error:
Running via Spring preloader in process 4267
/usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- readline (LoadError)
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/2.3.0/irb/completion.rb:10:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/console.rb:3:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:58:in `console'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /home/james/Desktop/myapp/bin/rails:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `block in load'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
EDIT
I try second solution in #Vasfed link, and it give me following error:
make: *** No rule to make target `/internal.h', needed by `readline.o'. Stop.
Readline gem is required by your application but not specified in your Gemfile
Please add this to your gem file
gem 'rb-readline'
Also reinstall
libreadline-dev
If you installed from source, install libredline-dev first and then go to ruby-2.3.0/ext/readline (or wherever the source code is)/ext/readline.
ruby extconf.rb
make
make install
if you get an error, edit Makefile after runing extconf.rb and add top_srcdir = ../.. after archdir = $(rubyarchdir).
Then, run make && make install again.
You need some extra dependencies
sudo apt-get install build-essential libssl-dev curl libcurl3 libreadline-dev libcurl4-openssl-dev libffi-dev libgdbm3 libgdbm-dev
After installing dependences, do this in ruby source code folder:
.configure
make
sudo make install
The accepted answer (installing the gem rb-readline) is a workaround.
Don't do that, instead, your ruby should be installed with ext/readline.
For that you need ncurses devel and readline devel libraries
In CentOS that is
yum install readline readline-devel ncurses ncurses-devel
For Ubuntu, read Abel's anwer.
Oh, and after installing the libraries, you should recompile your ruby.

Error installing ruby-1.9.3-p547 with RVM on osx 10.9.3

How can I get around this error:
$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p547.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: DYLD_LIBRARY_PATH environment variable is set, this might interact with the compilation and ruby.
Installing Ruby from source to: /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p547, this may take a while depending on your cpu(s)...
ruby-1.9.3-p547 - #downloading ruby-1.9.3-p547, this may take a while depending on your connection...
ruby-1.9.3-p547 - #extracting ruby-1.9.3-p547 to /Users/TomCaflisch/.rvm/src/ruby-1.9.3-p547...
ruby-1.9.3-p547 - #applying patch /Users/TomCaflisch/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p547 - #configuring.
Error running './configure --prefix=/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/Cellar/libyaml/0.1.4:/usr/local/Cellar/readline/6.2.4:/usr/local/Cellar/libksba/1.3.0:/usr/local/Cellar/openssl/1.0.1e --without-tcl --without-tk --disable-install-doc --enable-shared',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1404187306_ruby-1.9.3-p547/configure.log
[2014-06-30 23:01:50] ./configure
current path: /Users/TomCaflisch/.rvm/src/ruby-1.9.3-p547
GEM_HOME=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327
PATH=/Users/TomCaflisch/.rvm/usr/bin:/usr/local/Cellar/pkg-config/0.28/bin:/usr/local/Cellar/libtool/2.4.2/bin:/usr/local/Cellar/automake/1.14/bin:/usr/local/Cellar/autoconf/2.69/bin:/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327/bin:/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327#global/bin:/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p327/bin:/Users/TomCaflisch/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin
GEM_PATH=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327:/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327#global
command(7): ./configure --prefix=/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/Cellar/libyaml/0.1.4:/usr/local/Cellar/readline/6.2.4:/usr/local/Cellar/libksba/1.3.0:/usr/local/Cellar/openssl/1.0.1e --without-tcl --without-tk --disable-install-doc --enable-shared
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/Users/TomCaflisch/.rvm/src/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
There has been an error while running configure. Halting the installation.
I'm rocking osx 10.9.4 at the moment.
When i do $ rvm get latest, I get this error:
$ rvm get latest
Downloading https://get.rvm.io
Downloading https://github.com/wayneeseguin/rvm/archive/1.25.28.tar.gz
Upgrading the RVM installation in /Users/TomCaflisch/.rvm/
RVM PATH line found in /Users/TomCaflisch/.bashrc /Users/TomCaflisch/.zshrc.
RVM sourcing line found in /Users/TomCaflisch/.bash_profile /Users/TomCaflisch/.zprofile.
Installing gem-wrappers gem in 4 gemsetsError running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391557_ruby-1.9.3-p484/gem.install.gem-wrappers->=1.2.4.log
PATH=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p484#global/bin:/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/bin:/Users/TomCaflisch/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin
GEM_PATH=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p484#global
command(7): gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc
Error loading RubyGems plugin "/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p484#global/gems/executable-hooks-1.2.6/lib/rubygems_plugin.rb": dlopen(/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle
Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle (LoadError)
/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/yaml.rb:84:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
ERROR: Loading command: install (LoadError)
dlopen(/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle
Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Error running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391559_ruby-2.0.0-p247/gem.install.gem-wrappers->=1.2.4.log
Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/psych.bundle
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:1:in `<top (required)>'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/yaml.rb:5:in `<top (required)>'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb:659:in `load_yaml'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:327:in `load_file'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:196:in `initialize'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `new'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:39:in `run'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/bin/gem:21:in `<main>'
Error running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391560_ruby-2.1.0-preview1/gem.install.gem-wrappers->=1.2.4.log
Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/x86_64-darwin12.5.0/psych.bundle
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/psych.rb:1:in `<top (required)>'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/yaml.rb:5:in `<top (required)>'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems.rb:659:in `load_yaml'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/config_file.rb:326:in `load_file'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/config_file.rb:195:in `initialize'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/gem_runner.rb:74:in `new'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/gem_runner.rb:39:in `run'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/bin/gem:21:in `<main>'
Error running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391560_ruby-2.1.0-preview2/gem.install.gem-wrappers->=1.2.4.log
Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/x86_64-darwin12.0/psych.bundle
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/psych.rb:1:in `<top (required)>'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/yaml.rb:5:in `<top (required)>'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems.rb:659:in `load_yaml'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/config_file.rb:327:in `load_file'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/config_file.rb:196:in `initialize'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:74:in `new'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:39:in `run'
from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/bin/gem:21:in `<main>'
.
Upgrade of RVM in /Users/TomCaflisch/.rvm/ is complete.
# Tom Caflisch,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
Upgrade Notes:
* No new notes to display.
RVM reloaded!
Was running in to the same issue. Just ran these commands sorted everything out...
$ xcode-select --install - this seems to be the key.
$ rvm cleanup all - may need to run sudo on this one.
$ rvm get latest
$ rvm install ruby-1.9.3- with whatever patch.
Hope this works for you!
Looks like you're missing the Xcode command line tools.
Try running
xcode-select --install
then run
gcc --version
to see if GCC or LLVM is installed. If it is, you can try installing ruby through RVM again.
I had the same issue. For me this solved the problem:
Launch Xcode. When it launched for me it asked permission to finish downloading and installing a few things (sorry I don't recall the exact message or if it even listed the items). I agreed and waited for it to finish download/installation.
I tried rvm install 1.9.3 again and it worked. rvm get latest also now works without issue.

bundle install fails on rugged but 'gem install rugged' works

I am trying to install Gitorious on Redhat 5. I am following these instructions: https://gitorious.org/gitorious/pages/Rhel_Installation
One of the steps is: rake db:create RAILS_ENV=production
That command fails with the foll error message:
[ gitorious ] sudo rake db:create RAILS_ENV=production
Could not find libdolt-0.33.14 in any of the sources
Run `bundle install` to install missing gems.
When I ran 'bundle install' it fails with:
0: makeup (0.4.4) from /usr/local/lib/ruby/gems/2.0.0/specifications/makeup-0.4.4.gemspec
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for gmake... yes
checking for cmake... yes
-- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'libgit2', not found
-- /usr/bin/gmake
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-git2-dir
--without-git2-dir
--with-git2-include
--without-git2-include=${git2-dir}/include
--with-git2-lib
--without-git2-lib=${git2-dir}/
extconf.rb:16:in `sys': ERROR: '/usr/bin/gmake' failed (RuntimeError)
from extconf.rb:59:in `block (2 levels) in <main>'
from extconf.rb:54:in `chdir'
from extconf.rb:54:in `block in <main>'
from extconf.rb:51:in `chdir'
from extconf.rb:51:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.0.0/bundler/gems/rugged-5f1b6d177132 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.0.0/bundler/gems/extensions/x86_64-linux/2.0.0-static/rugged-0.19.0/gem_make.out
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:89:in `run'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:37:in `block in build'
/usr/local/lib/ruby/2.0.0/tempfile.rb:324:in `open'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:160:in `chdir'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:160:in `block in build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:159:in `synchronize'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:159:in `build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:195:in `each'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:195:in `build_extensions'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/installer.rb:677:in `build_extensions'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/source/path.rb:174:in `generate_bin'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/source/git.rb:161:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:111:in `block in install_gem_from_spec'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/rubygems_integration.rb:150:in `with_build_args'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:110:in `install_gem_from_spec'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:265:in `block in install_sequentially'
/usr/local/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/usr/local/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:264:in `install_sequentially'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:97:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:15:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/cli.rb:255:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor.rb:363:in `dispatch'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor/base.rb:440:in `start'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/cli.rb:10:in `start'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/bin/bundle:20:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/bin/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
An error occurred while installing rugged (0.19.0), and Bundler cannot continue.
Make sure that `gem install rugged -v '0.19.0'` succeeds before bundling.
I did do 'sudo gem install rugged -v '0.19.0'` and it works:
[ gitorious ] sudo gem install rugged -v '0.19.0'
Building native extensions. This could take a while...
Successfully installed rugged-0.19.0
Parsing documentation for rugged-0.19.0
unable to convert "\x80" from ASCII-8BIT to UTF-8 for ../../extensions/x86_64-linux/2.0.0-static/rugged-0.19.0/rugged/rugged.so, skipping
unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/rugged/rugged.so, skipping
1 gem installed
I tried 'sudo bundle install --verbose' again but it fails the same way.
I then created a /usr/lib/pkgconfig/zlib.pc file and did a setenv of the PKG_CONGIF_PATH to add /usr/lib/pkgconfig.
zlib.pc:
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include
sharedlibdir=/usr/lib
Name: zlib
Description: zlib compression library
Version: 1.2.3
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
Cflags: -I${includedir}
I ran 'sudo bundle install --verbose' and it fails the same way...
The 'Gemfile' is in the main gitorious directory.
Any suggestions?
You're missing dependencies. I don't know the entirety of what you need, but based on libdolt and libgit2 you would need the following:
yum install python-devel libicu-devel zlib-devel
If I am not wrong, there were many changes made to rugged later on, and it caused some version problem with cmake.
Installing latest cmake version, fixed similar problem for me. Try:
yum install cmake

Resources