You just add the following line to your local ~/.gemrc
file (it is in your home folder):
gem: --no-document
or you can add this line to the global gemrc
config file.
Here is how to find it (in Linux):
strace gem source 2>&1 | grep gemrc
The --no-document
option is documented in the RubyGems CLI Reference.
You don't need to build the gem locally. In your gemfile you can specify a github source with a ref, branch or tag.
gem 'rails', git: 'git://github.com/rails/rails.git', ref: '4aded'
gem 'rails', git: 'git://github.com/rails/rails.git', branch: '2-3-stable'
gem 'rails', git: 'git://github.com/rails/rails.git', tag: 'v2.3.5'
Then you run bundle install
or the short form is just bundle
.
Read more about it here: http://bundler.io/man/gemfile.5.html#GIT
Update: There's a github source identifier.
gem 'country_select', github: 'stefanpenner/country_select'
However, they warn against using it: NOTE: This shorthand should be avoided until Bundler 2.0, since it currently expands to an insecure git:// URL. This allows a man-in-the-middle attacker to compromise your system.
After Bundler 2.0, you can get around the above issue with this statement near the top of the Gemfile:
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
Best Solution
well, that depends on the project in question. Some projects have a *.gemspec file in their root directory. In that case, it would be
Other projects have a rake task, called "gem" or "build" or something like that, in this case you have to invoke "rake ", but that depends on the project.
In both cases you have to download the source.