避免镜子安装新发布的gem

Bundler 1.3.0刚刚发布(到目前为止只安装了10个人 ),但我只能安装预版本或以前的版本。

$ gem install bundler --version 1.3.0 --verbose HEAD http://rubygems.org/specs.4.8.gz 302 Moved Temporarily HEAD http://production.s3.rubygems.org/specs.4.8.gz 304 Not Modified ERROR: Could not find a valid gem 'bundler' (= 1.3.0) in any repository HEAD http://rubygems.org/prerelease_specs.4.8.gz 302 Moved Temporarily HEAD http://production.s3.rubygems.org/prerelease_specs.4.8.gz 304 Not Modified ERROR: Possible alternatives: bundler $ gem install bundler --version 1.3.0 --clear-sources --source http://rubygems.org --verbose HEAD http://rubygems.org/specs.4.8.gz 302 Moved Temporarily HEAD http://production.s3.rubygems.org/specs.4.8.gz 304 Not Modified ERROR: Could not find a valid gem 'bundler' (= 1.3.0) in any repository HEAD http://rubygems.org/prerelease_specs.4.8.gz 302 Moved Temporarily HEAD http://production.s3.rubygems.org/prerelease_specs.4.8.gz 304 Not Modified ERROR: Possible alternatives: bundler $ gem install bundler --verbose HEAD http://rubygems.org/latest_specs.4.8.gz 302 Moved Temporarily HEAD http://production.s3.rubygems.org/latest_specs.4.8.gz 304 Not Modified Installing gem bundler-1.2.4 /Users/agrimm/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.2.4/.gitignore  /Users/agrimm/.rbenv/versions/2.0.0-p0/bin/bundle Successfully installed bundler-1.2.4 Parsing documentation for bundler-1.2.4 Parsing sources... 100% [100/100] lib/bundler/vlad.rb Done installing documentation for bundler (2 sec). 1 gem installed 

我如何告诉rubygems查看规范的存储库,而不是过时的镜像?

我从rubygems.org下载了gem文件 ,并使用gem install path/to/gem/file安装了它。

有人说他们是通过gem install bundler --pre ,但是我没试过。

在你的Gemfile中试试这个:

 gem "nokogiri", :git => "git://github.com/tenderlove/nokogiri.git", :branch => "1.4" git "git://github.com/wycats/thor.git", :tag => "v0.13.4" gem "thor" 

http://gembundler.com/git.html

或者尝试这个gem:
https://github.com/rdp/specific_install