Reputation: 1063
I am trying to install gems in a Ruby Mac OSX app. I have:
export GEM_HOME=/usr/local/...
However this requires sudo access which I'm trying to avoid. Where do you install it so it installs inside the directory of the app? In the Resources folder or somewhere else?
Upvotes: 0
Views: 614
Reputation: 17958
Applications are usually expected not to modify their own bundle (their application directory). Unless you are planning to ship these gems as part of your app you should probably create a gem home for them in your application's "Application Support" directory.
The Application Support directory is where your app stores any type of file that supports the app but is not required for the app to run, such as document templates or configuration files. The files should be app-specific but should never store user data. This directory is located inside the Library directory.
Never store files at the top level of this directory: Always put them in a subdirectory named for your app or company.
If the resources apply to all users on the system, such as document templates, place them in /Library/Application Support. To get the path to this directory use the NSApplicationSupportDirectory search path key with the NSLocalDomainMask domain. If the resources are user-specific, such as workspace configuration files, place them in the current user’s ~/Library/Application Support directory. To get the path to this directory use the NSApplicationSupportDirectory search path key with the NSUserDomainMask domain.
Upvotes: 1