首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用BubbleWrap的RubyMotion

使用BubbleWrap的RubyMotion
EN

Stack Overflow用户
提问于 2012-06-02 22:17:42
回答 1查看 864关注 0票数 1

我刚刚开始尝试Ruby Motion (v1.9),在将BubbleWrap (v0.2.1)加入到我的项目中时遇到了一些问题。

我的Rakefile看起来像这样:

代码语言:javascript
复制
$:.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

我也尝试过使用

需要“冒泡包装”

但是我总是得到一个错误,看起来像这样:

代码语言:javascript
复制
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一起使用吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-03 04:02:06

更新:该问题已在气泡包装0.3.1版本中修复

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

现在,你可以使用像RVM或rbenv这样的工具来安装一个单独的Ruby副本并使用它,或者你也可以通过将第14行修改为下面的代码来手动修补/Library/Ruby/Gems/1.8/gems/bubble-wrap-0.2.1/lib/bubble-wrap.rb

代码语言:javascript
复制
path = /^\.|\/Users\/|\/Library\/Ruby\/Gems\//.match(x) ? x : File.join('.', x)
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10863002

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档