简体   繁体   中英

rack-cache not found in any of the sources error

I'm new to creating a rails application. I'm going through this tutorial , and running into the issue when launching rails server. When I execute the commands (rails server or bundle exec rails server) I get the following error:

←[31mCould not find rack-cache-1.0.3 in any of the sources←[0m
←[33mRun `bundle install` to install missing gems.←[0m

I'm not sure why this is happening, because rack-cache is installed. I've already run bundle install, but that doesn't fix anything.

This is my gemfile

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

gem 'json'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', "  ~> 3.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
end

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

my gem list is:

abstract (1.0.0)
actionmailer (3.1.0, 3.0.0)
actionpack (3.1.0, 3.0.0)
activemodel (3.1.0, 3.0.0)
activerecord (3.1.0, 3.0.0)
activeresource (3.1.0, 3.0.0)
activesupport (3.1.0, 3.0.9, 3.0.0)
arel (2.2.1, 1.0.1)
bcrypt-ruby (3.0.1 x86-mingw32)
builder (3.0.0, 2.1.2)
bundler (1.0.18)
childprocess (0.2.2)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.1.2)
commonwatir (2.0.2, 1.9.2)
diff-lcs (1.1.2)
erubis (2.7.0, 2.6.6)
execjs (1.2.9)
ffi (1.0.9 x86-mingw32)
firewatir (1.9.4, 1.9.2)
hike (1.2.1)
hoe (2.10.0)
i18n (0.6.0, 0.4.2)
jquery-rails (1.0.14)
mail (2.3.0, 2.2.19)
metaclass (0.0.1)
mime-types (1.16)
mocha (0.9.12)
multi_json (1.0.3)
nokogiri (1.5.0 x86-mingw32)
polyglot (0.3.2)
rack (1.3.3, 1.2.4)
rack-cache (1.1)
rack-mount (0.8.3, 0.6.14)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.1.0, 3.0.0)
railties (3.1.0, 3.0.0)
rake (0.9.2)
rautomation (0.6.3)
rdoc (3.9.4)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
rubigen (1.5.6)
rubyzip (0.9.4)
s4t-utils (1.0.4)
sass (3.1.7)
sass-rails (3.1.2)
selenium-webdriver (2.6.0)
sprockets (2.0.0)
sqlite3 (1.3.4 x86-mingw32)
taglob (1.1.2)
taza (0.8.7)
term-ansicolor (1.0.6)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.29)
uglifier (1.0.3)
user-choices (1.1.6.1)
watir (2.0.2, 1.9.2)
watir-webdriver (0.3.3)
win32-api (1.4.8 x86-mingw32)
win32-process (0.6.5)
win32console (1.3.0 x86-mingw32)
windows-api (0.4.0)
windows-pr (1.2.0)
xml-simple (1.1.0)

Make sure you are not getting any of these: Invalid gemspec in [/var/lib/gems/1.8/specifications/rack-cache-1.0.3.gemspec]: invalid date format in specification: "2011-08-27 00:00:00.000000000Z"

If so, edit the gemspec file and change the dates to "2011-08-27" removing 00:00:00.000000000Z

This is the same for any of the gems, not just rack-cache.

It looks like rack-cache 1.1 is being loaded but Rails is looking for 1.0.3. Since your Gemfile.lock list lost its indentation it's not clear which gem is requiring it but you might try putting gem 'rack-cache', '1.0.3' or gem 'rack-cache', '~> 1.0.3' at the top of your Gemfile (after gem 'rails' ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM