我正在關注cancan cancan can set can set can set can cancan(http://railscasts.com/episodes/192-authorization-with-cancan?autoplay=true)。can not use cancan
我有紅寶石1.9.3 和軌道3.2.3
我的寶石文件有這些內容
group :test, :development do
gem 'rspec-rails', '~> 2.5'
end
group :test do
gem 'cucumber-rails', '1.0.6'# use this instead of the one in the book
gem 'capybara'
gem 'database_cleaner'
end
gem 'dynamic_form'
gem 'factory_girl'
gem 'devise', '~>1.4.3'
gem 'email_spec'
gem 'cancan'
和environment.rb文件中我已經加入
config.gem 'cancan'
當我運行捆綁命令我看到這...
Using warden (1.0.6)
Using devise (1.4.9)
Using dynamic_form (1.1.4)
Using rspec-core (2.11.0)
Using rspec-expectations (2.11.1)
Using rspec-mocks (2.11.0)
Using rspec (2.11.0)
現在我的問題是:當我運行:
sudo rake gems:install
那麼爲什麼我看到:
Could not find warden-1.0.6 in any of the sources
Run `bundle install` to install missing gems.
並以我gem.lock文件爲什麼它顯示...
devise (1.4.9)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.0.3)
你的Ruby是如何安裝的?運行軟件包安裝後,爲什麼你要做sudo rake gems:install? – Remear 2012-07-09 15:41:08
我用rvm來安裝ruby。我正在做sudo耙寶石:安裝,因爲它在那一集裏。但是當我這樣做的時候,它告訴我需要先運行bundle安裝,因爲gem warden 1.0.6缺失並且需要它。 – 2012-07-09 17:01:09