2011-09-08 63 views
0

我得到的束此错误安装找不到链轮,2.0.0.beta.9任何来源

$ bundle install 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3. 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#each called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#each called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
Fetching source index for http://rubygems.org/ 
Could not find sprockets-2.0.0.beta.9 in any of the sources 

这是一个新的代码库,我从一个朋友了,我在我的电脑上运行时遇到问题。我创建了相同的rvm gemset。 Gemfile如下:

source 'http://rubygems.org' 

gem 'rails', :git => 'git://github.com/rails/rails.git' 
gem 'rack', :git => 'git://github.com/rack/rack.git' 
gem 'rdiscount', :git => 'https://github.com/rtomayko/rdiscount.git' 
gem 'stringex' 

gem 'mysql' 
gem 'mysql2' 
gem 'oauth' 
gem 'twitter' 
gem 'gmail' 

group :development, :test do 
    gem 'rspec', :git => 'https://github.com/rspec/rspec.git' 
    gem 'rspec-rails', :git => 'https://github.com/rspec/rspec-rails.git' 
    gem 'rspec-mocks', :git => 'https://github.com/rspec/rspec-mocks.git' 
    gem 'rspec-core', :git => 'https://github.com/rspec/rspec-core.git' 
    gem 'rspec-expectations', :git => 'https://github.com/rspec/rspec-expectations.git' 
    gem 'selenium-webdriver' 
    gem 'steak', :git => 'https://github.com/cavalle/steak.git' 
    gem 'factory_girl', :git => 'https://github.com/thoughtbot/factory_girl.git' 
    gem 'unicorn' 
    gem 'capistrano' 
    gem 'database_cleaner' 
end 

我假设这是下载最新的Rails版本?我相信这可能是问题所在。

回答

1

指向git仓库的master分支并不是一个好主意,特别是如果你没有在SCM中提交Gemfile.lock

我鼓励您使用:git替换为使用宝石版本。

您也可以删除重复的依赖关系。例如,如果包含rspec-rails,则不需要列出rspec-core和所有rspec-库。它们已经列在rspec-rails依赖列表中。列出所有依赖关系并将它们指向主分支是肯定会引起多个头痛的原因。

另外,为什么你使用mysql gem两次?

source 'http://rubygems.org' 

gem 'rails', '3.1.0' 
gem 'rdiscount' 
gem 'stringex' 

gem 'mysql' 
gem 'mysql2' 
gem 'oauth' 
gem 'twitter' 
gem 'gmail' 

group :development, :test do 
    gem 'rspec-rails', '~> 2.6.0' 
    gem 'selenium-webdriver' 
    gem 'steak' 
    gem 'factory_girl' 
    gem 'unicorn' 
    gem 'capistrano' 
    gem 'database_cleaner' 
end 
+0

当你说到master分支时,你的意思是我应该做一个代码叉而不是克隆它吗? – donald

+0

不,我的意思是你应该使用稳定的gem版本,而不是git master版本库,除非真的需要。看我的例子。 –

相关问题