I have a git repository locally which contain a SDK project in ruby. I want to install the gem file from this local repo. It has the gemfile and gemspec files as well. Please help me on this. I tried to find a solution online but all of them are for .gem file which is locally stored not for a repo it self.
When you use the --user-install option, RubyGems will install the gems to a directory inside your home directory, something like ~/. gem/ruby/1.9. 1 . The commands provided by the gems you installed will end up in ~/.
The gem command allows you to interact with RubyGems. Ruby 1.9 and newer ships with RubyGems built-in but you may need to upgrade for bug fixes or new features. To upgrade RubyGems, visit the download page. If you want to see how to require files from a gem, skip ahead to What is a gem. Finding Gems.
In your local repository:
gem build yourlocalrepo.gemspec
This will create a .gem
file.
Now:
gem install yourlocalrepo.gem
If your SDK project's gem was initialized by bundle gem
command, the modern way for starting a gem, then the gem project would be configured so that the basic gem related tasks are available through the rake
command of the project.
Namely, in my gem project I can execute
rake install:local
to build the gem being developed and install the artifact to local system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With