在任何来源中都找不到sprockets-2.0.0.beta.9

时间:2011-09-08 08:43:14

标签: ruby ruby-on-rails-3 rubygems

我在捆绑安装上遇到此错误

$ 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 个答案:

答案 0 :(得分:1)

指向git存储库的主分支并不是一个好主意,特别是如果您未在SCM中提交Gemfile.lock

我建议您替换:git引用以使用gem版本。

您还可以删除重复的依赖项。例如,如果您包含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