I have some trouble here. I am working with a Rails 2.3 project (working on the production server through ssh - don't ask why). Here is the Gemfile. When delayed_jobs is trying to start, the output says I need to install the bundler gem. The problem is that the gemdir is /var/lib/gems/1.8/ and I don't have the write priviliges for that directory. However there is a directory under ~/projects/shared/gems/ruby/1.8/gems where I can write.
How can I define the installation path for a gem?
You can also just set a bundle install path using a Bundler configuration file. I wrote a post that you can check out if you'd find it helpful.
To install foo gem to a specified folder, just use
--install-dir
option, i.e.It helps when:
bundle install
- e.g. if one wants to install bundle gem itself, or wants to install a gem (which is not listed in Gemfile) into the bundle foldersudo gem install
command fails due to lack of write-permissions for a default installation pathHope that helps.
The environment variable
GEM_HOME
defines the gem installation location. You need to set it to desired location. The command is OS specific.In Windows it is
set
Linux would be
export
bundler accepts a --path option.
You can add the following to your config.ru file:
This will tell your rack app where to look for gems.
Also configure your server .bashrc: