Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Require a modified gem source code

I am trying to require a gem source code that I've downloaded and modified. The require works for the main file, but the main file require other files (classes and modules) and unfortunately, these classes and modules are loaded from the previously installed gem (via gem command) and not the locally modified ones.

I am doing a require './lib/foo', any idea to tell the require to load only local files?

EDITED: My require './lib/foo' is working. foo is the local version I want. But foo does other requires, and theses requires point to the files of the gem installed (which I don't want as I am trying to correct stuff inside).

like image 617
Hartator Avatar asked Aug 19 '26 12:08

Hartator


1 Answers

uninstall the original gem from system by command

  gem uninstall some_gem

then go the root of downloaded source code and build your own gem from modified source with command

  gem build some_gem.gemspec

the install the gem by specifying the generated source file name.

  gem install some_gem-version 
like image 102
Sachin Singh Avatar answered Aug 22 '26 08:08

Sachin Singh