Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local override for {gem} at /path/to/local/git/repo is using branch develop but Gemfile specifies develop

I'm running bundler v1.3.0.pre.2 and trying to get bundler to bundle a local git repository holding a gem, into a rails app.

Gemfile :

gem 'mygem', :github => 'myrepo/mygem', :branch => 'develop'

Config :

bundle config local.mygem /path/to/local/git/repo

Bundle install throws the error :

Local override for mygem at /path/to/local/git/repo is using branch develop but Gemfile specifies develop

Is this a bug ? I see that the branch names are exactly the same. What could be wrong ? Got the same error for Bundler v1.2.3 as well

like image 769
letronje Avatar asked Dec 13 '12 07:12

letronje


1 Answers

You can use a local gem and even the branch you are working on like this

gem 'rspec-rails', path: '~/forks/rspec-rails', branch: 'feature-branch'

Just change github to path, Then

bundle install

Also as far as bundler config goes, although it is in the docs, I have never needed to change the local config like you did above.

With this method I have never needed to remove Gemfile.lock, it just picks up the changes to your local repo.

Although I don't recommend it, you could disable the branch checking feature used by bundler to make sure you are using the correct branch when developing

bundle config disable_local_branch_check true
like image 70
fontno Avatar answered Oct 04 '22 21:10

fontno