Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
924 views
in Technique[技术] by (71.8m points)

ruby on rails - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...