I have a relatively new installation of rvm
to use to manage Ruby and now I am trying to install gems and use them. I can perform gem list
and see the installed gems:
jblanchard$ gem list
*** LOCAL GEMS ***
bigdecimal (default: 1.4.1)
bundler (default: 1.17.2)
cmath (default: 1.0.0)
csv (default: 3.0.4)
date (default: 2.0.0)
dbm (default: 1.0.0)
e2mmap (default: 0.1.0)
etc (default: 1.0.1)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
forwardable (default: 1.2.0)
gem-wrappers (1.4.0)
io-console (default: 0.4.7)
ipaddr (default: 1.2.2)
irb (default: 1.0.0)
json (default: 2.1.0)
locksmith (0.1.1)
...
When I perform gem env
I see the executable directory:
jblanchard$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.0.1
- RUBY VERSION: 2.6.1 (2019-01-30 patchlevel 33) [x86_64-darwin17]
- INSTALLATION DIRECTORY: /Users/jblanchard/.rvm/gems/ruby-2.6.1
- USER INSTALLATION DIRECTORY: /Users/jblanchard/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /Users/jblanchard/.rvm/rubies/ruby-2.6.1/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /Users/jblanchard/.rvm/gems/ruby-2.6.1/bin
- SPEC CACHE DIRECTORY: /Users/jblanchard/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/jblanchard/.rvm/rubies/ruby-2.6.1/etc
However, none of the gems are in the bin/ and I get a "command not found" when trying to use them. I have found the gems in the cache/ directory, but adding that directory to the path doesn't help.
cache jblanchard$ ls -la
total 64
drwxr-xr-x 5 jblanchard staff 160 Feb 26 08:02 .
drwxr-xr-x 11 jblanchard staff 352 Feb 25 12:40 ..
-rw-r--r-- 1 jblanchard staff 13312 Feb 25 12:40 gem-wrappers-1.4.0.gem
-rw-r--r-- 1 jblanchard staff 8192 Feb 26 08:02 locksmith-0.1.1.gem
-rw-r--r-- 1 jblanchard staff 7680 Feb 26 08:02 tuwaga-0.0.3.gem
I have tried all of the suggestions in Gem Command not found, Ruby Gems returns "command not found" and a couple of other answers here on Stack, to no avail.
Here is my .bashrc file where paths are defined.
# Add gems executable path..
export PATH="$PATH:$HOME/.rvm/gems/ruby-2.6.1/bin"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
Have I done something wrong? Shouldn't rvm put the gems in the bin/? Is there something I can do to make sure gems are installed there?