I would like to download a gem without installing all the required gems for a given gem.

Specifically for the Rails 3 gem. It has a lot of dependencies, and I need to install it on a closed server which currently has no ruby/rake/rails software.

Any clues would be great as clicking through rubygems.org is tedious.

okay, let me clarify this a bit. What I would like is for this to work:

gem install rails --download-only

which would solve my problems as then I could burn the resulting gem's onto a disc and move them over to my server which doesn't have Internet access.

link|improve this question
Not sure that this is possible. That is why they are called dependencies. They depend on other things that you have to have to work. – soandos Aug 19 '11 at 18:45
feedback

3 Answers

Unfortunately you cannot get around the dependency issue. They are needed for a reason; Trying to install Rails without needed dependencies is going to result in a lot of issues, if Rails even runs at all.

You didn't specify exactly what you meant by closed. If you mean closed as in you cannot install systemwide software, have a look at RVM, which is software that will allow you to create a self-contained Ruby environment. You might also be able to get away with setting this up on another server and moving it over if the server has no connection to the internet. Have a look at it and see if this helps you out.

link|improve this answer
If I can't manually download the gem's then I'll probably have to use this method: I'll use a linux VM and create a rails complete install package. – Daniel Aug 19 '11 at 20:30
feedback
up vote 0 down vote accepted

Well, I hate to answer my own question but I think this is the most likely to be the solution for my question.

- find network enabled machine
- install rails and all needed gems using RubyGems.
- tar/zip /usr/lib[64]/ruby/gem/1.9.1/cache/*.gem
- transport tar file to non-networked computer.

The location of those gem cached files is very useful. If I had numerous gem's on my networked machine and didn't want to transport all the gems I would have used

> bundle list

to show the application specific gems needed.

-daniel

link|improve this answer
feedback

I would create a local RubyGems server with all the gems required for the application, including Rails and its dependencies.

Basic documentation here:

This blog post shows how to set up an internal server that you can send Gems to for automatic indexing:

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.