1

我正在尝试根据本教程将 cocoapods 集成到 ruby​​motion 中,但是,当我运行时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 并检查了它是否在我的 gem 列表中。

4

1 回答 1

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

虽然我platform在 pod 定义中遇到了一个错误,但是除非你真的需要它,否则你可能会删除它,那么这就是你的下一个问题:)

于 2013-12-12T02:02:57.753 回答