我刚刚开始使用Ruby Motion(第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吗?
答案 0 :(得分:3)
UPDATE :自泡泡包装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)