What's the difference between GEM_HOME and GEM_PATH?
GEM_PATH
provides the locations (there may be several) where gems can be found.
GEM_HOME
is where gems will be installed (by default).
(Therefore GEM_PATH
should include GEM_HOME
).
$GEM_HOME and $GEM_PATH are wrongly set in Passenger
Reason for this issue was user_sandboxing by passenger
Since my app directory was owned by root, and I had no passenger_default_user
configured in nginx, passenger was staring application as user nobody
and group nogroup
I fixed this issue by changing owner of my app directory to a non-root user.
Note: Also I had to go with rvm instead of ruby:2.3.1 base image.
How to change gem installation directory on Mac?
You need to set your GEM_HOME
and GEM_PATH
GEM_PATH
specifies the locations where gems is to be found.
GEM_HOME specifies the location where the gems will be installed.
export GEM_HOME=<new location>
But if you do not want to change the Path and just want to install a few gems, you can also do the following:
gem install --install-dir /path_to_new_directory my-gem-name
example:
gem install --install-dir /Users/xyz/Desktop sass
will install rails on the Desktop
gem locations in macOS with chruby and TextMate preferences
Changed GEM_HOME
and GEM_PATH
to $HOME/.gem/ruby/2.6.2:$HOME/.rubies/ruby-2.6.2/lib/ruby/gems/2.6.0
based on copying the those variables from what showing up when running from the terminal. Lu's comment made me look a little harder at what was being reported. Basically I was missing $HOME/
in the second path (after the colon). I have been fiddling with this for months
Related Topics
Ruby Read CSV File as Utf-8 And/Or Convert Ascii-8Bit Encoding to Utf-8
How to Check to See If My Array Includes an Object
How to Run Ruby and Git Commands in One Place on Windows
Is There a Natural_Sort_By Method for Ruby
Rails - Cannot Run App: Unable to Load the Eventmachine C Extension;
How to Test a File Upload in Rails
Best Practice for Rails App to Run a Long Task in the Background
Add Nullable Foreign Key in Rails
Differencebetween Integer and Fixnum
Rails 3.1 Pipeline - Exclude JavaScript File
How to Debug in Rubymine 4.5 Using Ruby 1.9.3
Get Index of String Scan Results in Ruby
Ruby SQLite3 Installation SQLite3_Libversion_Number() MACos Sierra