ruby-on-rails - 如何配置 Bundler 以使用本地 gem 依赖项

标签 ruby-on-rails ruby qt rubygems bundler

Qt 库在 OSX 12 (Sierra) 上损坏,这是 gem capybara-webkit 的依赖项之一。所以目前如果 capybara-webkit 在 Gemfile 中,对于大多数人来说 bundle install 将会失败。

a workaround for this ,其中涉及手动安装Qt,然后使用本地版本安装gem ...

$ PATH=~/Qt5.5.1/5.5/clang_64/bin:$PATH gem install capybara-webkit

我想将 bundler 配置为始终使用 Qt 的这个本地副本,这样我就不必记住在每个 gemset 中都这样做。这可能吗?我看过 Bundler config文档,但不太明白我在找什么。

理想情况下,我希望找到一种解决方案,该解决方案使用我可以传递给我的团队的可移植配置文件,而不是他们都必须运行的一系列命令。

感谢您的任何建议!

最佳答案

尝试添加 local git repo用于 bundler 。

Bundler also allows you to work against a git repository locally instead of using the remote version. This can be achieved by setting up a local override:

bundle config local.GEM_NAME /path/to/local/git/repository

For example, in order to use a local Rack repository, a developer could call:

bundle config local.rack ~/Work/git/rack

Now instead of checking out the remote git repository, the local override will be used. Similar to a path source, every time the local git repository change, changes will be automatically picked up by Bundler. This means a commit in the local git repo will update the revision in the Gemfile.lock to the local git repo revision. This requires the same attention as git submodules. Before pushing to the remote, you need to ensure the local override was pushed, otherwise you may point to a commit that only exists in your local machine.

如果您当前的 Qt 本地副本不在 git 存储库中,您可以简单地克隆主存储库并将您的更改推送到本地计算机上。

关于ruby-on-rails - 如何配置 Bundler 以使用本地 gem 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41947754/

相关文章:

ruby-on-rails - 即使在重新启动服务器后,Rails 开发环境也不会更新 html/css/assets

ruby-on-rails - postgres 导入 csv 并自动填充 ID 并创建和更新

ruby - Binding.irb 使用 IRB 调试时如何跳到下一行

c++ - 如何创建一个继承自QWidget的qt插件

c++ - 如何使用 qmake 设置 C++ 项目的可执行属性?

ruby-on-rails - Rails API + AngularJS + Websocket-Rails gem

ruby-on-rails - 我应该如何测试 Rails 枚举?

ruby - 使用正则表达式替换字符串中的参数

sql - Rails + PostgreSQL SSL 解密失败

css - QTextDocument 中的自定义字体