rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

uninitialized constant BubbleWrap::Location #290

Closed eric-khoury closed 11 years ago

eric-khoury commented 11 years ago

Hi guys! Justing starting out with this very exciting project. I know this has been an issue before, and I have the feeling I am missing something obvious, in which case I'm sorry for stealing your time. I'm trying to use the gem by putting it in my gem file ("gem 'bubble-wrap', '~> 1.3.0' "), or by pointing to this repo. Doesn't seems to work.

When trying the example code snippet from the read me, I still get the error saying I have an uninitialized constant BubbleWrap::Location.

Hmmm.

clayallsopp commented 11 years ago

Did you require 'bubble-wrap/location' anywhere in your code or add a :require option to the line in your Gemfile?

eric-khoury commented 11 years ago

Ok, that solved the error. I gave up on the bundle way and just added require 'bubble-wrap/location' to my Rake file. I don't fully understand this yet, do I need to require every part I need seperately? Anyway, Thx.

clayallsopp commented 11 years ago

You should be able to do:

gem 'bubble-wrap', '~> 1.3.0', :require => 'bubble-wrap/location'

If you ever want to require more parts of BW, :require also takes an array:

gem 'bubble-wrap', '~> 1.3.0', :require => ['bubble-wrap', 'bubble-wrap/media', 'bubble-wrap/location']

BubbleWrap is split into different components so you don't have to compile all the things when you only need a subset, like only BW::Location. You can see the different components and instructions in the readme