timpone
timpone

Reputation: 19969

capistrano and assets:precompile not working due to rake versioning issue

I get the following error on a capistrano deploy:

enter image description here

If I run that commmand from the command line, I get the following: You have already activated rake 0.9.2, but your Gemfile requires rake 10.0.3. Using bundle exec may solve this.

From my Gemfile

gem 'rake', '10.0.3'

When I look at Gemfile.lock, I see only three mentions of rake:

railties (3.1.10)
  rake (>= 0.8.7)
rake (10.0.3)
rake (= 10.0.3)

This seems like fixing it at 10.0.3 should be fine.

Why am I getting this and how do I resolve this? What would happen if I ran gem uninstall rake? Would Capistrano still work after that?

thx in advance

edit 1 different rake versions:

root@curren:/data/sites/domain.com/apps/app-rails/current# rake -V
rake, version 0.9.2
root@curren:/data/sites/domain.com/apps/app-rails/current# bundle exec rake -V
rake, version 10.0.3

Upvotes: 3

Views: 822

Answers (2)

Duke
Duke

Reputation: 7444

For Cap 3:

SSHKit.config.command_map[:rake] = "bundle exec rake"

Upvotes: 3

Andreas Lyngstad
Andreas Lyngstad

Reputation: 4927

If there is no reason not to update rake, you can run

bundle update rake

This will actually update your Gemfile.lock to use the newest version of rake

if you want to keep rake 0.9.2 uninstall the newest

gem uninstall rake
#result on my box
Select gem to uninstall:
 1. rake-0.8.7
 2. rake-10.0.1
 3. rake-10.0.2
 4. All versions

This Yehuda Katz blog post explains more.

Upvotes: 2

Related Questions