I'm trying to include gems from my local instead of the gemserver on development. My Gemfile looks like this:
group :development do
gem "appy_core", path: "../engines/core"
group :production do
gem "appy_core", '184.108.40.206'
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: appy_core (>= 0) and appy_core (= 220.127.116.11). Bundler cannot continue.
bundle install --without production
The only solution I came up with / am aware of:
gem 'appy_core', git: 'git://github.com/.......', branch: '18.104.22.168' # put the name of the branch that corresponds
in local environment’s shell:
$ bundle config local.appy_core /path/to/engines/core
Now do whatever you want in the local branch, commit it locally and enjoy.
Hack that works
Gemfile is plain ruby, one might use ruby features there:
somewhere in permanent shell settings:
alias bundle="USE_DEV_VERSION=1 bundle"
if ENV['USE_DEV_VERSION'] gem "appy_core", path: "../engines/core" else gem "appy_core", '22.214.171.124' end
bundle install will use dev version locally and the standard gem outside of the “patched” environment.