2011-09-08 64 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版本庫,除非真的需要。看我的例子。 –

相關問題