rails-geocoder environmental problem in Rails 3 app - ruby-on-rails-3

I'm working with Alex Reisner's geocoder gem on a Rails 3 app (3.0.3) because I'm concerned about GeoKit's shakey Rails 3 compatibility. Alex's gem looked perfect for my application so I started using it and had it working flawlessly last night on my Macbook. I pushed the app to Github when I got it running.
Today, I did a git clone of the app on a desktop Mac. Same version of Ruby, Rails and identical source and Gemfile. This time geocoder is throwing this exception:
NameError (uninitialized constant Geocoder::Net):
app/controllers/restaurants_controller.rb:16:in `create'
My models use after_validation :fetch_coordinates to geocode the model upon save.
Has anyone noticed any other dependencies outside the bundle that could cause this? I like the way Alex put this one together but may give geokit-rails3 a try even though it's an unfinished port.

I just released gem version 0.9.7 which should solve this problem.

Related

Ruby soundcloud Gem : uninitialized constant SoundCloud (NameError)

I installed the SoundCloud ruby gem but when I tried running the example 'Print links of the 10 hottest tracks' on this page
https://github.com/soundcloud/soundcloud-ruby
I kept getting an error message "uninitialized constant SoundCloud (NameError)"
I did follow the instruction on the example, registered a client and got my client_id (not sure how to get the access token, which is not required in this example)
I followed the instruction on http://docs.rubygems.org/read/chapter/3 to add require 'soundcloud' to the example code but i still keep getting the same error message.
I am using OSX terminal.
sorry i'm new to ruby and soundcloud API so my question might be very entry level.
The README showed currently on GitHub doesn't match the version 0.3.1 of the gem that you have probably installed.
Changing SoundCloud to Soundcloud should fix your problems.
Please update to version 0.3.2. The README documents the latest interface.

Omniauth-facebook rails 3 => invalid credentials error

I am using omniauth-facebook gem in my rails app to authenticate with facebook.
Everything worked fine, but recently i have "invalid credentials" error in my production server. (in local it still works great).
I've read that it is due to the last version of the gem (1.4.1) and downgrading to 1.4.0 should solve the problem.
But it does not work for me and i don't know where to look.
ps: i have rails 3.2.11
Thanks for you help.

Heroku Forcing Me to Push Gemfile Each Time

I have a requirement in my Rails application (3.0.7) for the gem yajl-ruby. For some weird reason, every time I do a push, Heroku (Bamboo stack) doesn't recognize that the gem is listed in my gemfile.
So what happens is that my application crashes each time I do not push the gemfile. To fix this, I need to change something in my gemfile (like add a character to a comment or something inconsequential like that) and push the gemfile to Heroku again (even though there were no gem changes). It doesn't make sense because when I close from my Heroku git (even when the app is in a crashed state), the gemfile is fine, with yajl-ruby in there.
Has anyone else ever had a similar issue? I'm trying to figure out why this is and how it can be rectified so I don't need to keep making these small changes to my gemfile and pushing it?

Gem for push notifications for Android and iOS

I am working on a project in Ruby 1.9.2 and Rails 3 and I am looking for a gem to send push notifications to my iOS app and to my Android app.
I have found one for iOS jtv-apns gem but as I have asked in this question, I haven't been able to make it work and I haven't received any answers yet.
I have also found apn_on_rails but as the instructions are not for rails 3, I don't know if it is compatible.
For android, all I have found is c2dm_on_rails so far, but only works with ruby 1.8 and rails 2.
As suggested in this question, Urban ship is not an option for me right now. I would like to implement it myself or find a gem to help me do that.
Do you know any gem I can use for ruby 1.9 and rails 3 or a good tutorial I can follow?
I ended up using apn_on_rails the rails 3 branch. You can find a really good tutorial here
And for android I used speed_c2dm
Use Prowl iOS client and
prowler gem
http://www.prowlapp.com
If someone knows a better solution that is up2date please post as comment!

Cannot Deploy App w/ Heroku - Rake::DSL Error

I'm using Rails v. 3.0.9 and have pushed the app to Heroku. When I view the custom Heroku domain I get the following message from Heroku:
"We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly."
I run heroku logs and don't seem to get any error messages. The only error I encounter with Heroku seems to be when I run heroku rake db:migrate with which I get the following in return:
rake aborted!
uninitialized constant Rake::DSL
Note: I'm new to Rails and to Heroku. I'm not quite understanding the difference between production and development environments. Do I need to be in production for Heroku to work? At the moment, I'm using localhost3000 to view my app. Thanks guys!
I have a blog post about it here:
http://codeglot.com/posts/13-you_have_already_activated_rake_0_9_2
There are two solutions. Use an older version of rake or require DSL.