How to remove uninstall jekyll because traceback error

I’ve made a bit of a mess of my ruby and jekyll.

If I run:

$ jekyll

I get:

Traceback (most recent call last):
	16: from /home/rene/gems/bin/jekyll:23:in `<main>'
	15: from /usr/lib/ruby/2.5.0/rubygems.rb:309:in `activate_bin_path'
	14: from /usr/lib/ruby/2.5.0/rubygems.rb:309:in `synchronize'
	13: from /usr/lib/ruby/2.5.0/rubygems.rb:310:in `block in activate_bin_path'
	12: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
	11: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
	10: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
	 9: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1472:in `block in activate_dependencies'
	 8: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
	 7: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
	 6: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
	 5: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1472:in `block in activate_dependencies'
	 4: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
	 3: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
	 2: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
	 1: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1469:in `block in activate_dependencies'
/usr/lib/ruby/2.5.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'ffi' (~> 1.9) among 51 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/home/rene/.gem/ruby/2.5.0:/var/lib/gems/2.5.0:/usr/lib/x86_64-linux-gnu/rubygems-integration/2.5.0:/usr/share/rubygems-integration/2.5.0:/usr/share/rubygems-integration/all:/home/rene/gems', execute `gem env` for more information

then i try:

$ which jekyll

and that results with:

/home/rene/gems/bin/jekyll

What do I need to do to troubleshoot this?

And if I run:

$ bundle exec jekyll build
Could not locate Gemfile or .bundle/ directory

I’m worried I’ve installed jekyll twice and that is part of the problem.

you probably have ruby installed twice - try uninstalling it and then check if ruby is installed and then re-install ruby.

Good idea.

$ which ruby
/usr/bin/ruby

$ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]

$ which gem
/usr/bin/gem

$ gem --version
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
3.1.4

If I had it installed twice it should show up from the which command. I found this issues thread on github but I don’t understand what I should do for the fix:

The problem was first noticed when making updates to a jekyll site I was working on. I tried updating everything with $ sudo apt update && sudo apt upgrade and gem update --system but it only made the problem worse. Here is my system info if that is any help:

$ uname -a
Linux MSI-7817 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Since then, I have also restored my .bashrc file hoping to address some conflicts:

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || ech$

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile

^G Get Help  ^O Write Out ^W Where Is  ^K Cut Text  ^J Justify   ^C Cur Pos
^X Exit      ^R Read File ^\ Replace   ^U Uncut Text^T To Spell  ^_ Go To Line

so I have very little idea how this works, so I can’t help much, and not exactly sure this is the problem, but maybe you only have ruby installed once, but it sure looks like you have gems in two places - some in the path above and some at usr/lib/ruby.

Or maybe just that path is wrong?

not sure why it points there with that command yet your error at the top is looking somewhere else.

Course this could just be where I have no idea what I am doing and they are the same place? I’m not good with this stuff, just noticing the path differences.

Yeah I think you’re right that it is one of those two (or both) situations.

Maybe, when I was trying to fix I reinstalled rubygems in a duplicate place and edited the PATH to break it altogether. I’m sure there is a solution or work around but I can’t figure it out yet.

Thanks.

I’d still try uninstalling, checking to make sure it is gone and then re-install ruby.

Maybe first try: gem env and see what that says.

I think your path is incorrect for ruby, in your first post where it says checked in Gem Path there are a bunch of paths separated by colons? at least I think that is what it is. I’m guessing that is a problem. I think when you re-install ruby it will reset this for you? though maybe it just appends to the list?

I did notice the PATH may have had a conflict, and so I restored a clean .bashrc and .profile

I have tried to uninstall and reinstall ruby but no change. This is result of gem env:

$ gem env
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.4
  - RUBY VERSION: 2.5.1 (2018-03-29 patchlevel 57) [x86_64-linux-gnu]
  - INSTALLATION DIRECTORY: /var/lib/gems/2.5.0
  - USER INSTALLATION DIRECTORY: /home/rene/.gem/ruby/2.5.0
  - RUBY EXECUTABLE: /usr/bin/ruby2.5
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /home/rene/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/2.5.0
     - /home/rene/.gem/ruby/2.5.0
     - /usr/lib/x86_64-linux-gnu/rubygems-integration/2.5.0
     - /usr/share/rubygems-integration/2.5.0
     - /usr/share/rubygems-integration/all
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin

How do I:

  1. change the configuration file?
  2. change the PATH
  3. completely remove rubygems and the then reinstall

Thanks again.