installing multiple ruby gems of specific versions at the same time

Wes's Avatar


14 Apr, 2011 09:40 PM

Hi all, I'm new to ruby gems and ruby and the such. I was just wondering, if I wanted to install multiple ruby gems at the same time, and I wanted to specify the version, how would I go about doing such a thing in unix? Right now, I have something like this

In a file called gemtest, I have

gem install --version '= 0.43' --ignore-dependencies linecache
gem install --version '= 0.1.7' --ignore-dependencies linkedin

When i type this into unix: cat gemtest | xargs sudo

ERROR: Could not find a valid gem 'linecache' (= 0.1.7) in any repository
ERROR: Could not find a valid gem 'gem' (= 0.1.7) in any repository
ERROR: Could not find a valid gem 'install' (= 0.1.7) in any repository
Successfully installed linkedin-0.1.7
1 gem installed
... (installs rdoc and stuff)

My question is, why doesn't it successfully install both? And why does it put the version specified at the end of the file for all other gems in the file (this example has 2, the one I'm trying to work with is 50 or so).

I guess my question is, can someone educate me as to the syntax of gem install? Haha :) thanks

  1. Support Staff 1 Posted by Nick Quaranto on 21 Apr, 2011 01:22 PM

    Nick Quaranto's Avatar

    You should be able to do gem install rails -v 3.0.0. The options/flags should work in any combination. You probably need the dependencies as well.

    Another thing you could try are RVM gemsets:

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac