"invalid gem" with different versions of ruby and its packages - ruby

I know very little about ruby and its package management. On a Ubuntu 16.04 system, there seems to be something messed up with different versions of ruby. I tried to run pdfbeads ruby program.
$ pdfbeads -o all.pdf
/home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require': iconv will be deprecated in the future, use String#encode instead.
/home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:128:in `require': libMagickCore.so.5: cannot open shared object file: No such file or directory - /home/t/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-linux/1.9.1/rmagick-2.13.4/RMagick2.so (LoadError)
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:39:in `require'
from /home/t/.rvm/gems/ruby-1.9.3-p551/gems/rmagick-2.13.4/lib/rmagick_internal.rb:11:in `<top (required)>'
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/t/.rvm/gems/ruby-1.9.3-p551/gems/rmagick-2.13.4/lib/RMagick.rb:1:in `<top (required)>'
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/t/.rvm/gems/ruby-1.9.3-p551/gems/pdfbeads-1.1.1/lib/pdfbeads.rb:35:in `<top (required)>'
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/t/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/t/.rvm/gems/ruby-1.9.3-p551/gems/pdfbeads-1.1.1/bin/pdfbeads:38:in `<top (required)>'
from /home/t/.rvm/gems/ruby-1.9.3-p551/bin/pdfbeads:23:in `load'
from /home/t/.rvm/gems/ruby-1.9.3-p551/bin/pdfbeads:23:in `<main>'
from /home/t/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval'
from /home/t/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'
I first found that the default pdfbeads isn't the one for the latest version of ruby, so I call the latter directly:
$ which pdfbeads
/home/t/.rvm/gems/ruby-1.9.3-p551/bin/pdfbeads
$ whereis pdfbeads
pdfbeads: /usr/local/bin/pdfbeads /home/t/.rvm/gems/ruby-1.9.3-p551/bin/pdfbeads
$ whereis gem
gem: /usr/bin/gem2.3 /usr/bin/gem /home/t/.rvm/rubies/ruby-1.9.3-p551/bin/gem /usr/share/man/man1/gem.1.gz
$ gem --version
2.4.3
$ /usr/local/bin/pdfbeads -o all.pdf
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Ignoring nokogiri-1.6.6.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.6.2
Ignoring rmagick-2.13.4 because its extensions are not built. Try: gem pristine rmagick --version 2.13.4
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- iconv (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/t/.rvm/gems/ruby-1.9.3-p551/gems/pdfbeads-1.1.1/bin/pdfbeads:35:in `<top (required)>'
from /usr/local/bin/pdfbeads:23:in `load'
from /usr/local/bin/pdfbeads:23:in `<main>'
Hoping to solve the problem, I run the suggested gem command, but what does the error mean here?
$ gem pristine executable-hooks --version 1.3.2
Restoring gems to pristine condition...
Cached gem for executable-hooks-1.3.2 not found, attempting to fetch...
Fetching: executable-hooks-1.3.2.gem (100%)
ERROR: While executing gem ... (Gem::InstallError)
invalid gem: No such file or directory - /home/t/.rvm/gems/ruby-1.9.3-p551#global/cache/executable-hooks-1.3.2.gem
How can I clean up the old version of ruby and its packages, if I only need the newer version?
Thanks.

You are missing some libraries (imagemagick). Please try installing them:
sudo apt-get install imagemagick libmagickwand-dev
After that try again to install your gem.
To cleanup old version of a gem run:
gem cleanup pdfbeads
To uninstall a specific ruby version run:
rvm remove 1.9.3
You can also take a look in the folder /home/t/.rvm/ and clean up by hand. But do that with care. Or just take a look in this folder to find out which ruby versions and gemsets are installed and clean up with the rvm commands.

Related

Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16

I'm receiving this giant error when i try to install bundler or rails or even when i try to start the server. any suggestions please? I am a beginner and have no idea what to do??? I already tried what the error suggested (install libyaml) and reinstalling ruby but it still does the same thing. Also tried gem pristine all but nothing.
gem install bundler
Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16
Ignoring bindex-0.8.1 because its extensions are not built. Try: gem pristine bindex --version 0.8.1
Ignoring bootsnap-1.13.0 because its extensions are not built. Try: gem pristine bootsnap --version 1.13.0
Ignoring bootsnap-1.7.5 because its extensions are not built. Try: gem pristine bootsnap --version 1.7.5
Ignoring byebug-11.1.3 because its extensions are not built. Try: gem pristine byebug --version 11.1.3
Ignoring date-3.3.3 because its extensions are not built. Try: gem pristine date --version 3.3.3
Ignoring debug-1.7.1 because its extensions are not built. Try: gem pristine debug --version 1.7.1
Ignoring debug-1.6.2 because its extensions are not built. Try: gem pristine debug --version 1.6.2
Ignoring digest-3.1.0 because its extensions are not built. Try: gem pristine digest --version 3.1.0
Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7
Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Ignoring ffi-1.15.1 because its extensions are not built. Try: gem pristine ffi --version 1.15.1
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0
/Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Traceback (most recent call last):
23: from /Users/angie/.rvm/rubies/ruby-2.7.4/bin/gem:21:in `<main>'
22: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:44:in `run'
21: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `do_configuration'
20: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `new'
19: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/config_file.rb:182:in `initialize'
18: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/config_file.rb:332:in `load_file'
17: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems.rb:715:in `load_yaml'
16: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
15: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
14: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/yaml.rb:4:in `<top (required)>'
13: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
12: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
11: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych.rb:15:in `<top (required)>'
10: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
9: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
8: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/nodes.rb:2:in `<top (required)>'
7: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
6: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
5: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/nodes/node.rb:4:in `<top (required)>'
4: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
3: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
2: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/psych/scalar_scanner.rb:2:in `<top (required)>'
1: from /Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
/Users/angie/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': dlopen(/Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle, 0x0009): tried: '/Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/strscan.bundle' (no such file), '/usr/lib/strscan.bundle' (no such file) - /Users/angie/.rvm/gems/ruby-2.7.4/gems/strscan-3.0.4/lib/strscan.bundle (LoadError)

Library not loaded (libcrypto)

After updating ruby and rubyenv packages I'm facing an error. The libcrypto library is not loaded.
When executing the suggested command it seems that it is searching for openssl in ruby /Users/User/.rvm/rubies/ruby-2.4.1. But on my system I use /usr/local/Cellar/ruby/2.6.5.
$ gem pristine executable-hooks --version 1.3.2
Error loading RubyGems plugin "/Users/User/.rvm/gems/ruby-2.4.1#global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": dlopen(/Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
Reason: image not found - /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle (LoadError)
ERROR: Loading command: pristine (LoadError)
dlopen(/Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
Reason: image not found - /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I used the above command to diagnose another error (maybe this helps):
$ bundle install --system
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Ignoring unf_ext-0.0.7.4 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.4
/Users/User/.rbenv/versions/2.3.1/lib/ruby/2.3.0/digest.rb:16:in `const_missing': library not found for class Digest::MD5 -- digest/md5 (LoadError)
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/source/rubygems/remote.rb:26:in `cache_slug'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:107:in `cache_path'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:83:in `compact_index_client'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/cli.rb:630:in `warn_on_outdated_bundler'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/cli.rb:15:in `ensure in start'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/cli.rb:16:in `start'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/exe/bundle:35:in `block in <top (required)>'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/exe/bundle:27:in `<top (required)>'
from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
mdm:ios si$ export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"
mdm:ios si$ bundle install --system
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Ignoring unf_ext-0.0.7.4 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.4
/Users/User/.rbenv/versions/2.3.1/lib/ruby/2.3.0/digest.rb:16:in `const_missing': library not found for class Digest::MD5 -- digest/md5 (LoadError)
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/source/rubygems/remote.rb:26:in `cache_slug'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:107:in `cache_path'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:83:in `compact_index_client'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/cli.rb:630:in `warn_on_outdated_bundler'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/cli.rb:15:in `ensure in start'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/cli.rb:16:in `start'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/exe/bundle:35:in `block in <top (required)>'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
from /Users/User/.rvm/gems/ruby-2.4.1#global/gems/bundler-1.15.1/exe/bundle:27:in `<top (required)>'
from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
I did a quick test:
rvm 2.6.5
To determine that ruby-2.6.5 was not installed, so I installed it:
rvm install "ruby-2.6.5"
You say you are using the system Ruby from /usr/local/ yet the error messages are from an RVM installation.
You need to either uninstall RVM, or set the system Ruby as default for RVM:
rvm --default use system
More discussion here:
Disable RVM or use Ruby which was installed without RVM?

Ruby Gem Scrypt 2.1.1 won't install on Windows

I'm asked to look at some Ruby code. The developers run OSX, I'm on Windows. All is working fine on OSX, but I get an error with Scrypt 2.1.1.
I'm asked by Ruby to run: gem install scrypt -v '2.1.1' which results in an error.
When I do gem install scrypt -v '2.1.1' --platform=ruby it's quite the opposite and all the gem is installed.
Now when I recreate the GemFile or update it, I still get an error and it's again suggested to run gem install scrypt -v '2.1.1'.
The output I'm getting is:
Installing scrypt 2.1.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: <MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt
C:/Ruby23-x64/bin/ruby.exe -rubygems <MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake RUBYARCHDIR=<MyProject>/vendor/bundle/ruby/2.3.0/extensions/x64-mingw32/2.3.0/scrypt-2.1.1 RUBYLIBDIR=<MyProject>/vendor/bundle/ruby/2.3.0/extensions/x64-mingw32/2.3.0/scrypt-2.1.1
rake aborted!
LoadError: cannot load such file -- ffi_c
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:6:in `rescue in <top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:3:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-compiler-0.1.3/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt/Rakefile:1:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<main>'
LoadError: cannot load such file -- 2.3/ffi_c
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:4:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-compiler-0.1.3/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt/Rakefile:1:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<main>'
LoadError: cannot load such file -- ffi-compiler/compile_task
<MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt/Rakefile:1:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<main>'
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in <MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1 for inspection.
I've looked and searched on Google and Bing, but nothing resulted in a solution.
Hope somebody in the community here can help me find the resolution.
Thanks,
Iwan
gem install ffi --platform=ruby
gem install scrypt -v 2.2.1
Works for me.

Jekyll fails to serve (Ruby incompatible library version)

When trying to run jekyll serve, it seems to build correctly (though with warnings that I haven't been able to resolve), but then fails to serve. jekyll build completes, but the resulting files are missing the compiled CSS.
Output from jekyll serve:
Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10
Ignoring curb-0.9.3 because its extensions are not built. Try: gem pristine curb --version 0.9.3
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Ignoring json-1.8.2 because its extensions are not built. Try: gem pristine json --version 1.8.2
Ignoring thin-1.6.1 because its extensions are not built. Try: gem pristine thin --version 1.6.1
Configuration file: /home/jtebert/OwnCloud/Projects/Programming/python/AMS/mockup/_config.yml
Source: /home/jtebert/OwnCloud/Projects/Programming/python/AMS/mockup
Destination: /home/jtebert/OwnCloud/Projects/Programming/python/AMS/mockup/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 1.404 seconds.
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': incompatible library version - /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/ffi-1.9.10/lib/ffi_c.so (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/ffi-1.9.10/lib/ffi.rb:6:in `rescue in <top (required)>'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/ffi-1.9.10/lib/ffi.rb:3:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/rb-inotify-0.9.7/lib/rb-inotify/native.rb:1:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/rb-inotify-0.9.7/lib/rb-inotify.rb:1:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/linux.rb:30:in `_configure'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:45:in `block in configure'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:40:in `each'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:40:in `configure'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/adapter/base.rb:63:in `start'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/backend.rb:26:in `start'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/listener.rb:67:in `block in <class:Listener>'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:120:in `instance_eval'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:120:in `call'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/fsm.rb:57:in `transition'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/listen-3.0.6/lib/listen/listener.rb:90:in `start'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-watch-1.3.1/lib/jekyll/watcher.rb:12:in `watch'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/lib/jekyll/commands/build.rb:72:in `watch'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/lib/jekyll/commands/build.rb:39:in `process'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/lib/jekyll/commands/serve.rb:34:in `block (2 levels) in init_with_program'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
from /home/jtebert/.rvm/gems/ruby-2.0.0-p643/gems/jekyll-3.1.3/bin/jekyll:13:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
When trying to start a Jekyll project, I did have to create a link of Ruby versions because it was looking for 'Ruby2.1', but I'm not sure if this is playing a role in the current problem: ln -s /usr/bin/ruby '/usr/bin/ruby2.1'.
According to my package manager, I've installed Ruby 2.3.0. But according to which ruby, I'm using 2.0.0 which it's getting from rvm: /home/xxxxxxx/.rvm/rubies/ruby-2.0.0-p643/bin/ruby. And as I mentioned before, Jekyll seems to want v2.1 for something. I'm guessing these conflicting versions are somehow causing the problem, but I don't know how to resolve it.
In my case I had to install the ffi library with gem:
gem install ffi
This error is probably caused by an older version of the library installed in the system. gem then installs the correct version for your project.
The problem for me seemed to be rvm (which I'm not sure how I ended up using). The solution was to remove rvm with rvm implode, then reinstall jekyll with gem install jekyll. Both the warnings and errors disappeared, and it is serving properly.

How to install ruby(rubygems) with openssl?

When running rvm rubygems latest I get the error.
How fix it?
Error running 'env GEM_PATH=/Users/sjc/.rvm/gems/ruby-2.0.0-p0:/Users/
sjc/.rvm/gems/ruby-2.0.0-p0#global:/Users/sjc/.rvm/gems/ruby-2.0.0-p0:
/Users/sjc/.rvm/gems/ruby-2.0.0-p0#global GEM_HOME=/Users/sjc/.rvm/gem
s/ruby-2.0.0-p0 /Users/sjc/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /Users/s
jc/.rvm/src/rubygems-2.0.0/setup.rb', please read /Users/sjc/.rvm/log/
ruby-2.0.0-p0/rubygems.install.log
The log (rubygems.install.log) has this:
[2013-03-05 20:31:37] /Users/sjc/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
/Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- openssl (LoadError)
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/security.rb:8:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/package.rb:43:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/installer.rb:8:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/request_set.rb:5:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems.rb:195:in `finish_resolve'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/rdoc.rb:14:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/uninstaller.rb:10:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/commands/setup_command.rb:440:in `uninstall_old_gemcutter'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/commands/setup_command.rb:144:in `execute'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/command.rb:305:in `invoke_with_build_args'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/command_manager.rb:170:in `process_args'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/command_manager.rb:130:in `run'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/gem_runner.rb:60:in `run'
from setup.rb:45:in `<main>'
RubyGems 2.0.0 installed
Because I didn't know what I was doing, I think my earlier attempt at installing sass may have caused this. I followed these instructions, thus doing these commands earlier in the day.
$ export GEM_HOME=/home/mygemrepository
$ ruby setup.rb --prefix=/home/mystuff
Again, I don't if that matters as GEM_HOME and GEM_PATH seem correct.
$ echo $GEM_HOME
/Users/sjc/.rvm/gems/ruby-2.0.0-p0
$ echo $GEM_PATH
/Users/sjc/.rvm/gems/ruby-2.0.0-p0:/Users/sjc/.rvm/gems/ruby-2.0.0-p0#global
Looks like you're missing openssl. Checkout: https://rvm.io/packages/openssl/
Examples for ruby 2.3.1, or may be other version of ruby.
Without reinstall rvm:
rvm pkg install openssl
rvm install 2.3.1 --with-openssl-dir=$HOME/.rvm/usr
Or with reinstall rvm:
rvm implode
\curl -sSL https://get.rvm.io | bash
rvm pkg install openssl
rvm install 2.3.1 --with-openssl-dir=$HOME/.rvm/usr
Or with custom rubygems for ruby < 2.3:
rvm pkg install openssl
rvm install 2.2.2 --rubygems 2.7.10 --with-openssl-dir=$HOME/.rvm/usr
PS: after all may be reinstall all ruby versions
rvm reinstall all --force
Another possible issue is if your default version of Ruby is old.
Most OS come preinstalled with Ruby, but use an older versions of Ruby (1.8.x), rather than 2.x or even 1.9.x and that may cause the new version of rvm to fail.
$ rvm list
to see the list of ruby versions install, and use ("ruby use uby-1.9.3-p429" equivalent ) to set that and then try :
$ rvm get stable
(get the most recent bugfixes and ruby version updates )
$ rvm rubygems latest
I also changed the default ruby :
$ rvm --default use 1.9.2
worked for me!

Resources