Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run bundle update on Windows

Whenever I run bundle update or bundle install on Windows 8.1 I can't update/install gems from github. I can install other gems like uglifier, but it doesn't work for github gems specifically. For example, putting this in the Gemfile

group :development, :test do
  gem 'rspec-rails', '2.13.1'
  gem 'spork-rails', github: 'sporkrb/spork-rails'
end

results in the error:

Retrying source fetch due to error (2/3): You need to install git to be able to use gems from git repositories.

The problem is I definitely have git installed. I was running this from Git Bash and working in a project that I was cloning, pulling, and working with off of Git. So why does the bundle update/install keep insisting that I don't have git installed? How do I fix it and make bundle install work?

like image 617
Kevin Avatar asked Sep 01 '26 18:09

Kevin


2 Answers

Are you running a pre-release version of Bundler? This commit might be related to your problem; it looks like earlier versions of Bundler scan your %PATH% for "git", but not "git.exe".

The easiest solution would be to backport bundler to 1.3.5:

gem uninstall bundler
gem install bundler
like image 189
Ash Wilson Avatar answered Sep 04 '26 12:09

Ash Wilson


Don't forget to select radio "Use git from Windows Command Prompt" while installing the Git. Thats the key! By default "Use git from Git Bash only" is set.

like image 32
Алексей Лещук Avatar answered Sep 04 '26 13:09

Алексей Лещук



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!