首页 > 解决方案 > Use local version of module from Github instead of installed

问题描述

I am working on a project written in Ruby, which depends on another module using require modulename. I can change the required module to add the features I need, but I don't want to modify my installed version. I've downloaded the module from git, but I don't know how to point my project to this local version.

标签: ruby

解决方案


Assuming the required module is a gem, you can use the path: option in Gemfile to define a local version of a gem. So in Gemfile:

gem 'modulename', path: 'relative/path/to/modulename'

However, remember to remove the path: option before committing any changes to your git repository as you don't want that going into production.


推荐阅读