1

I have a git-repo which i clone onto my servers to do some administrative stuff. Most of the scripts are ruby, i need some gems. Until now i just installed the gems using sudo, but that doesn't seem like a good idea.

I tried rvm and bundler, but i'm still not sure how to do it properly.

Usually i clone the repository into /root and symlink the scripts into /usr/local/bin. I think what i want is the gems to be installed into the repository itself, so that other people can use my scripts without fu*king up their rubygems installation.

Any ideas on how to proceed? I also don't know how to specify the gems in a way that the script in /usr/local/bin still find them.

Fabian Zeindl
  • 5,860
  • 8
  • 54
  • 78

1 Answers1

1

with RVM you can select separate gemset for gems and create a wrapper that will make binaries available always in PATH.

here is example with haml:

rvm use 1.9.3@tools --install --create
gem install haml
rvm wrapper 1.9.3@tools --no-prefix haml
mpapis
  • 52,729
  • 14
  • 121
  • 158