ruby - 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.
解决方案
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.
推荐阅读
- python - 从嵌套列表的列表理解构建字典
- scala - Scalaz 隐式分辨率混淆
- flutter - Flutter 键盘侦听器在每次刷新时复合构建
- javascript - 如何使用网络工作者导入模块?
- reactjs - 如何将证书附加到我的反应开发环境?
- python - 安装 Spoonacular API“没有名为 com 的模块”
- swift - 如何切换自动隐藏菜单栏设置?
- jquery - 如何下载应用过滤的数据表
- reactjs - React Component 不会在使用 useContext 的上下文更改时重新渲染
- arrays - 如何将字符串分配给 numpy 数组中的元素