【问题标题】:RubyMotion with BubbleWrap带有 BubbleWrap 的 RubyMotion
【发布时间】:2012-06-06 23:18:55
【问题描述】:

我刚刚开始使用 Ruby Motion (v 1.9),在我的项目中加入 BubbleWrap (v 0.2.1) 时遇到了一些问题。

我的 Rakefile 看起来像:

$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'rubygems'
require 'bubble-wrap'

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  app.name = "Hello"
  app.device_family = :ipad #[:ipad,:iphone]

  app.files += Dir.glob(File.join(app.project_dir, 'vendor/BubbleWrap/lib/**/*.rb'))
end

我也尝试过使用

需要“气泡包装”

但我总是收到如下所示的错误:

ERROR! Can't resolve dependency `/Library/Ruby/Gems/1.8/gems/bubble-wrap
0.2.1/lib/pollute.rb' because ./Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/pollute.rb 
is not in ["./app/app_delegate.rb", 
"./app/login_controller.rb", "/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/app.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/gestures.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/http.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/json.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/kernel.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/ns_index_path.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/ns_notification_center.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/ns_user_defaults.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/ui_button.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/ui_view_controller.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap/version.rb", 
"/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/pollute.rb"]

新版本的 RubyMotion 不能与 BubbleWrap 一起使用吗?

【问题讨论】:

  • 我没有适合您的解决方案,但我成功地使用了 Bubblewrap 0.2.1 和 Rubymotion 1.9 以及 Ruby 1.9.3p125(通过 RVM)。可能与使用 OSX 1.8 系统 Ruby 有关?

标签: rubymotion


【解决方案1】:

更新:自bubble-wrap 0.3.1 起已修复

这是bubble-wrap gem 中的一个错误,它试图在gem 的路径前加上./。我开了一个pull request

现在,您可以使用 RVM 或 rbenv 之类的东西来安装单独的 Ruby 副本并使用它,或者您可以通过将第 14 行更改为以下内容手动修补 /Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap.rb

path = /^\.|\/Users\/|\/Library\/Ruby\/Gems\//.match(x) ? x : File.join('.', x)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-31
    • 1970-01-01
    相关资源
    最近更新 更多