1

I've been using this gem for my facebook canvas app: https://github.com/dekart/facebooker2.git

Today I swapped it out for another facebook auth gem, decided I didn't like it and went back to my original.

I'm including the gem like this:

gem 'facebooker2', :git => "https://github.com/dekart/facebooker2.git"

Since I've made this change, the facebooker2 gem has being causing javascript errors in my app.

 window.fbAsyncInit = function() {
                        FB.init({
          appId  : 'myappid',
          status : true, // check login status
          cookie : true, // enable cookies to allow the server to access the session
          xfbml  : true,  // parse XFBML
          oauth  : true
          channelUrl : 'http://myurl/channel.html'
        });

There is a missing comma after the oauth: true this means my facebook login button will not render.

How do I fix this? Ideally, I'd like to go into the gem, see why it's missing the comma and fix it. Then use my fixed version of the gem on my local machine and on heroku. If you can offer an alternative solution, it would be much appreciated.

Benoit Garret
  • 14,027
  • 4
  • 59
  • 64
Finnnn
  • 3,530
  • 6
  • 46
  • 69

1 Answers1

1

There's a "Fork and edit this file" button on this page (near the top): https://github.com/dekart/facebooker2/blob/master/lib/facebooker2/rails/helpers/javascript.rb

You can edit the file directly on the Github website (hint: look at line 51) and use

gem 'facebooker2', :git=> "https://github.com/yourusername/facebooker2.git"

in your Gemfile to use your fork.

You can also be a good open-source citizen and submit a pull request afterwards, an obvious fix like this one is likely to be accepted fast.

Benoit Garret
  • 14,027
  • 4
  • 59
  • 64
  • you, sir, are a gentleman. The best answer I've received on stackoverflow so far. ** goes off to submit pull request** – Finnnn Dec 13 '11 at 15:11
  • @user597264 You're welcome! You'll also have to thank GitHub, their web interface is simply amazing for quick fixes like this one. – Benoit Garret Dec 13 '11 at 15:14