我敢肯定,我只是在这里忽略了一些简单的事情,但这让我整晚都发疯了!当尝试将 Rails 3.1.rc4 应用程序部署到 Heroku 上的 Cedar 堆栈时(我一个月前使用类似的 Gemfile 成功地做到了这一点),我收到此错误:
Could not find sprockets-2.0.0.beta.10 in any of the sources
我的 Gemfile 看起来像这样:
source 'http://rubygems.org'
# Core
gem 'rails', '3.1.0.rc4'
# Asset template engines
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-script'
gem 'uglifier'
# Misc
gem 'devise'
gem 'jquery-rails'
gem 'omniauth'
gem 'fb_graph'
gem 'compass', git: 'https://github.com/chriseppstein/compass.git', branch: 'rails31'
gem 'haml'
gem 'cancan'
gem 'kaminari'
gem 'friendly_id', '~> 3.3.0', git: 'https://github.com/norman/friendly_id.git'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'aws-ses', '~> 0.4.3', :require => 'aws/ses'
# Local Environment
group :test do
# Pretty printed test output
gem 'turn', :require => false
gem 'sqlite3'
end
# Heroku Environment
group :production do
gem 'pg'
gem 'execjs'
gem 'therubyracer'
end
四处寻找,找到this article在 Google 网上论坛上,我确定这必须通过添加这一行来解决
gem 'sprockets', '2.0.0.beta10'
到我的 Gemfile 然后运行
bundle update sprockets
这失败了
Could not find gem 'sprockets (= 2.0.0.beta10, runtime)' in any of the gem sources listed in your Gemfile.
在这一点上,我不知道该怎么做或如何处理。我是否可能需要升级到 Rails 3.1.rc5,如果需要,我该如何做到这一点而无需从头开始?
感谢您提供的任何帮助!
-罗伯特
最佳答案
只需将您的 Rails 版本提高到 rc5
gem 'rails', '3.1.0rc5'
然后:
bundle update
关于heroku - 部署 Rails 3.1.rc4 时 sprockets 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7054726/