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

Got error using BubbleWrap::Location #365

Closed andersennl closed 10 years ago

andersennl commented 10 years ago

I'm trying to use the following code from the readme from the bubblewrap.io website:

BW::Location.get do |result|
  p "From Lat #{result[:from].latitude}, Long #{result[:from].longitude}"
  p "To Lat #{result[:to].latitude}, Long #{result[:to].longitude}"
end

When raking, the app crashes and gives the following error:

uninitialized constant BubbleWrap::Location (NameError)

Things like

App.alert("BubbleWrap is awesome!")

work, so I suppose there is a bug. The BubbleWrap entry inside my Gemfile looks like this:

gem 'bubble-wrap', :git => 'https://github.com/rubymotion/BubbleWrap.git'

Thanks!

clayallsopp commented 10 years ago

Did you add require "bubble-wrap/location" to your Rakefile? (or add a require: ["bubble-wrap/location"] line to your Gemfile)

andersennl commented 10 years ago

When I add ''''require "bubble-wrap/location"'''' it works. I'm sorry, I got confused by the following line from the setup guide: If you wish to only include the core modules use the following line of code instead: ... I thought I only have to require them if I only need a specific wrapper and could use all of them when I require 'bubble-wrap'. Thanks!