Closed patrick-gleeson closed 7 years ago
I recently came across this issue as well. Actually it has to do with how the motion-game
rake tasks load the Ruby code. For example, when you run rake ios:simulator
this is what happens:
ios:simulator
rake task (defined here).config/ios.rb
file (skipping Bundler.require
in your main Rakefile)Now that I figured that out, it should be as simple as requiring any gems that you want to use in your config/ios.rb
, android.rb
, etc.
Nice, this sounds really promising. I'll investigate when I get a minute.
I require the gems I need on the config/ios.rb example:
require 'bubble-wrap'
require 'bubble-wrap/reactor'
require 'bubble-wrap/location'
require 'bubble-wrap/mail'
require 'motion_print'
require 'motion-social'
require 'sugarcube-nsdata'
require 'sugarcube-animations'
require 'helu'
Motion::Project::App.setup do |app|
# Use `rake ios:config' to see complete project settings.
and works really good
Forgive me if I'm being stupid: A lovely part of the RubyMotion toolkit is MotionBundler, that allows me to include any old gem in my RubyMotion project and
require
it when necessary. However, when using the motion-game template and MotionBundler, thoserequire
s suddenly cause a runtime error with messagerequire is not supported in RubyMotion
.If I can't use MotionBundler to require my gems in a MotionGame project, how can I use them?