When I run gem environment
I get a list which includes the following:
- GEM PATHS:
- /home/rescue/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0
- /home/rescue/.gem/ruby/2.3.0
I'd like to add a path. I see people suggesting to add something like export GEM_PATH = ...
to my .bashrc
file, but I fear this would replace the existing gem paths.
How can I add another path in addition to the ones that already exist?
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.
To install a gem, use gem install [gem] . Browsing installed gems is done with gem list . For more information about the gem command, see below or head to RubyGems' docs. There are other sources of libraries though.
run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.
When you run echo $GEM_PATH
you'll probably see 2 paths separated with colon. It's standard in setting multiple paths in env variables.
If you want to add more directories then you can add 1 more path without removing old ones with EXPORT GEM_PATH=$GEM_PATH:/your/new/path
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