suvankar
suvankar

Reputation: 1558

How could I install Gems from git repositories?

I need to install gem form git repository. repository contains .gemspec file. In my gem file i have following code:

gem 'echo_server', :git => 'http://127.0.0.1/org/echo_server.git'

When i am running bundle install gems are installer in .bundeler and not showing in gem list.

my question is: How the gem will be available in system, so that i can use in require ?

There are some similar SOQ but it does't help me.

Upvotes: 0

Views: 214

Answers (1)

blom
blom

Reputation: 3092

It is not showing up when you type gem list because it is not being installed like a regular gem. You can require it like you would any other library because Bundler knows about it and will set it up for you. You should see it in your $LOAD_PATH:

$LOAD_PATH.grep(/nameofgem/)

See the Bundler documentation on this for more information.

If instead you want to install it as a regular gem from the Git repository, you can clone the repository and then build and install the generated gem. For example:

gem build echo_server.gemspec
gem install echo_server-X.Y.Z.gem

There is also specific_install.

Upvotes: 2

Related Questions