Gems in ~/.gem vs in the Library

Hello all,

I am completely new to Ruby on Rails.

When i install gems some of them get installed to ~/.gem folder as apparently the other location is not writable.

What is the best way to go about this: chmod the folder in Library, let gems go to ~/.gem, sudo install gems always? What do you guys use?

Thanks in advance, Wojtek

Wojtek Galaj wrote in post #961468:

Hello all,

I am completely new to Ruby on Rails.

When i install gems some of them get installed to ~/.gem folder as apparently the other location is not writable.

What is the best way to go about this: chmod the folder in Library, let gems go to ~/.gem, sudo install gems always? What do you guys use?

Use sudo always, unless you're using RVM or you've changed your GEM_HOME permissions as Homrebrew recommends.

Thanks in advance, Wojtek

Best,

I use sudo for system lib, but also vendor everything when deployed. IMO gems in system lib should be treated like system software, could be used by other programs in OS or other users. If you have another local user they could overwrite the gem and cause problems for everyone.

Unfortunately that also means system lib is volatile and could be 'helpfully upgraded' at any moment by admins. I sure hope Gemfile is gem config tool that actually works...