Setting Environment Variables in Rails 3 (Devise + Omniauth)

You could take a look at the comments: You can either set environment variables directly on the shell where you are starting your server: FACEBOOK_APP_ID=12345 FACEBOOK_SECRET=abcdef rails server Or (rather hacky), you could set them in your config/environments/development.rb: ENV[‘FACEBOOK_APP_ID’] = “12345”; ENV[‘FACEBOOK_SECRET’] = “abcdef”; An alternative way However I would do neither. I would create … Read more

Omniauth Facebook Error – Faraday::Error::ConnectionFailed

I’ve fixed this on Mac OS X Lion 10.7.4 with this solution: $ rvm remove 1.9.3 (or whatever version of ruby you are using) $ rvm pkg install openssl $ rvm install 1.9.3 –with-openssl-dir=$rvm_path/usr after this you will need to download the missing cacert.pem file: $ cd $rvm_path/usr/ssl $ sudo curl -O http://curl.haxx.se/ca/cacert.pem $ sudo … Read more

Turn omniauth facebook login into a popup

Sure, you can easily. In your view: =link_to “Log in with Facebook”, omniauth_authorize_path(:user, :facebook), :class => “popup”, :”data-width” => 600, :”data-height” => 400 In your application.js: function popupCenter(url, width, height, name) { var left = (screen.width/2)-(width/2); var top = (screen.height/2)-(height/2); return window.open(url, name, “menubar=no,toolbar=no,status=no,width=”+width+”,height=”+height+”,toolbar=no,left=”+left+”,top=”+top); } $(“a.popup”).click(function(e) { popupCenter($(this).attr(“href”), $(this).attr(“data-width”), $(this).attr(“data-height”), “authPopup”); e.stopPropagation(); return false; }); … Read more

OmniAuth & Facebook: certificate verify failed [duplicate]

The real problem is that Faraday (which Omniauth/Oauth use for their HTTP calls) is not wasn’t setting the ca_path variable for OpenSSL. At least on Ubuntu, most root certs are stored in “/etc/ssl/certs”. Since Faraday isn’t wasn’t setting this variable (and currently does not have a method to do so), OpenSSL isn’t wasn’t finding the … Read more