I just got Ruby motion, and I wanted to try out Cocoapods. I installed it just as it asks on the website:
http://www.rubymotion.com/developer-center/articles/cocoapods/
I add
require ‘motion-cocoapods’ to my simple ‘Hello’ project. And I get this error when trying to rake it:
rake aborted!
Unable to activate cocoapods-0.16.1, because rake-10.0.3 conflicts with rake (~> 0.9.4)
I guess this has something to do with my version of rake, but I have no idea what I need to do to fix this problem. Please help!
This is caused by having a version of rake newer than 0.9.x installed. When you just run
rake, it loads up the newest version (10.0.3 in your case). Then, when the cocoapod gem tries to load, it tries to activate rake 0.9.x and fails (the~> 0.9.4means that it will accept any version starting with0.9.).One solution would be to completely remove the
rakegem and install the 0.9.4 version explicitly:However, this could become an issue if you have any other projects that require a newer version of rake. A better solution would be to use Bundler:
Create a
Gemfilein your project folder containing:Add the following to
Rakefile, immediately under therequire 'motion/project'line:Then run
bundle installfrom the console. This will lock this specific project on rake 0.9.6. The only catch is that you’ll probably need to prefix all of your rake commands withbundle exec.