I'm trying to edit one of the gem's config files and I can't find it. I'm not sure how I did this in the past.
When you use the --user-install option, RubyGems will install the gems to a directory inside your home directory, something like ~/. gem/ruby/1.9.
This location depends on how rubygems itself is configured. You can also run bundle package to store all the . gem files your app uses in vendor/cache . Running bundle install will prefer gems in vendor/cache to gems in other locations.
What does gem install do? gem install , in its simplest form, does something kind of like this. It grabs the gem and puts its files into a special directory on your system. You can see where gem install will install your gems if you run gem environment (look for the INSTALLATION DIRECTORY: line):
Since your goal is to verify a gem is installed with the correct version, use gem list . You can limit to the specific gem by using gem list data_mapper . To verify that it's installed and working, you'll have to try to require the gem and then use it in your code.
Look at your gem environment.
In a terminal run gem env
You should see an entry INSTALLATION DIRECTORY
, but there is also GEM PATHS
which is where it's loading all your gems from in your current environment.
Rvm
$ rvm gemdir
Or you can check:
echo $GEM_HOME
Bundler
$ bundle show --paths
For specific gem:
$ bundle show 'gem_name'
Gem
$ gem env
For specific gem:
$ gem which 'gem_name'
To see the default installation directory, run
gem env gemdir
If you want to change the default installation directory (for example, to ~/.gem/ruby/2.1.0), add this line to ~/.bashrc
export GEM_HOME=~/.gem/ruby/2.1.0
And you also need to make sure ~/.gem/ruby/2.1.0/bin is in your PATH environment variable to use the commands provided by gem packages. If not, add this line to ~/.bashrc
export PATH=$PATH:~/.gem/ruby/2.1.0/bin
If you are editing the gem's installed files, then the gem wasn't implemented correctly, or you are not modifying it correctly.
Proper gems are usually configured:
config/initializers
lib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With