尝试在rubymotion中安装cocoapods时出现Gem版本问题

时间:2013-10-10 15:23:47

标签: rubymotion cocoapods

我正在尝试根据此tutorial将cocoapods整合到rubymotion中,但是,当我运行rake时,我收到错误:

You have already activated i18n 0.6.5, but your Gemfile requires i18n 0.6.1. Using bundle exec may solve this.

我该怎么做,我尝试在Gemfile中指定gem版本,但它没有帮助。以下是我Rakefile中的代码。

$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'
require 'motion-cocoapods'

# if you use bundler
require 'bundler'
Bundler.require

# if you are not using bundler
# require 'rubygems'
# require 'ib'

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  app.name = 'IBSample'

  app.pods do
    platform :ios, '6.0'
    pod 'SWRevealViewController', '~> 1.0.5'
  end
end

更新:这是gemfile

# A sample Gemfile
source "https://rubygems.org"

gem "ib"
gem "rake"
# gem "i18n", "0.6.1"

当我运行bundle exec rake时,我得到了

cannot load such file -- motion-cocoapods

请注意,我已经安装了motion-cocoapods并检查它是否在我的宝石列表中。

1 个答案:

答案 0 :(得分:0)

解决方案显然只是定位。

删除require 'motion-cocoapods'并将gem motion-cocoapods放入您的Gemfile中,或从Rakefile中删除捆绑代码并手动需要所有内容。

$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'

require 'ib'
require 'motion-cocoapods'

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  app.name = 'IBSample'

  app.pods do
    platform :ios, '6.0'
    pod 'SWRevealViewController', '~> 1.0.5'
  end
end

虽然我因为pods定义中的platform而出现错误,但你可能会删除它,除非你确实需要它,那么这是你的下一个问题:)