1

I want to install a library to my rvm gemsets, but this library is not available using in the gem install. I have to install it from source

I do bundle install and it went well, except that It does not install the lib to the gemset but only the dependencies.

And I notice in the log this line Using xxx (a.b.c) from source at .

xxx is the library itself with version a.b.c and I can only use the library when I am in the source folder.

How to force to copy the library to the gemsets folder ?

w00d
  • 5,416
  • 12
  • 53
  • 85
  • What do you mean "install it from source"? Do you have a local gem file you want to install? So a gem file that isn't on a remote server, but only on your computer? – Vapire Apr 25 '13 at 23:58
  • It's a github repo and I clone it to my computer, cd to it and do a `bundle install` – w00d Apr 25 '13 at 23:59

1 Answers1

3

You could do one of the following:

1.: Use the :git option in your Gemfile for direct git(hub) access

gem 'gemname', :git => 'git://github.com/foo'

2.: Use the :path option in your Gemfile for local access

gem 'gemname', :path => '/path/to/foo'

3.: Install the local gem and use it in your Gemfile

# command line
gem install '/path/to/foo'

# Gemfile
gem 'foo'
Vapire
  • 4,568
  • 3
  • 24
  • 41
  • The (3) step is to run `gem install` and `gem 'foo'` or should I put it in the Gemfile ? – w00d Apr 26 '13 at 11:09
  • No, you have to run `gem install` first, but instead of specifying only the name, you specify the local path to your gem folder. Then you can simply put `gem 'foo'` in your Gemfile and run `bundle install` – Vapire Apr 26 '13 at 11:32