How can I install a local gem?


How can I install a local gem?



If I download a .gem file to a folder in my computer, can I install it later using gem install?




Has Object Prevalance (Prevayler, Madeleine) been used in a Production System?

1:



Unable to cat Ruby blocks to files
Yup, when you do gem install, it will search the current directory first, so if your .gem file is there, it will pick it up.


Is it acceptable practice to patch Ruby's base classes, such as Fixnum?
I found it on the gem reference, which you may find handy as well:.
How to compare Floats with delta?
gem install will install the named gem.


Why does Ruby seem to have fewer projects than other programming languages?
It will attempt a local installation (i.e.


How do I make a POST request with open-uri?
a .gem file in the current directory), and if that fails, it will attempt to download and install the most recent version of the gem you want..
How to increase stack size for a ruby app. Recursive app getting: Stack level too deep (SystemStackError)


Is There a Better Way of Checking Nil or Length == 0 of a String in Ruby?

2:


Also, you can use gem install --local path_to_gem/filename.gem. This will skip the usual gem repository scan that happens when you leave off --local.. You can find other magic with gem install --help..


3:


you can also just use the full filename to your gem file:.
gem install /full/path/to/your.gem 
this works as well -- it's probably the easiest way.


4:


If you create your gems with bundler:.
# do this in the proper directory bundle gem foobar 
You can install them with rake after they are written:.
# cd into your gem directory rake install 
Chances are, that your downloaded gem will know rake install, too..


5:


if you download the project file from github or other scm host site, use gem build to build the project first, so you can get a whatever.gem file in current directory.

Then gem install it!.


6:


Go to the path in where the gem is and call gem install -l gemname.gem.



82 out of 100 based on 62 user ratings 862 reviews