# FYI: Heroku Cedar, pg, openssl, omniauth, troubles and a solution

**URL:** <https://www.ruby-forum.com/t/fyi-heroku-cedar-pg-openssl-omniauth-troubles-and-a-solution/210250>\
**Category:** Rails\
**Created:** [August 3, 2011, 9:15am UTC](https://www.ruby-forum.com/t/fyi-heroku-cedar-pg-openssl-omniauth-troubles-and-a-solution/210250 "2011-08-03T09:15:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [August 3, 2011, 9:15am UTC](https://www.ruby-forum.com/t/fyi-heroku-cedar-pg-openssl-omniauth-troubles-and-a-solution/210250/1 "2011-08-03T09:15:25Z")

</div>

Hi guys,

I found a really nasty issue that affects people running on Heroku’s  
cedar  
stack. We are using Rails 3.1.rc5, pg 11, omniauth 2.6. Ruby is  
1.9.2.180p

Basically there is an incompatibility between the http, pg and OpenSSL  
modules which segfaults when making https calls, for example to log in  
through twitter. Now pg is a required gem when using Heroku cedar stack  
so  
leaving that one out is not an option. What fixed this was to add the  
following to my [config.ru](http://config.ru) at the top:

require ‘pg’  
require ‘openssl’

This ensures that pg is required before openssl and all is good now.

Hope this helps others in similar situations.

Best  
Martin

---

<div class="post-metadata">

**Author:** ![darkstar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b487fb/32.png) [@darkstar](https://www.ruby-forum.com/u/darkstar)\
**Post date:** [August 3, 2011, 3:12pm UTC](https://www.ruby-forum.com/t/fyi-heroku-cedar-pg-openssl-omniauth-troubles-and-a-solution/210250/2 "2011-08-03T15:12:31Z")

</div>

FWIW, I ran into this back on (I think) rc1 and had the problem locally  
as well. There was a bug noted somewhere on the ruby bug tracker  
relating to it - sorry I don’t have the url offhand. Thanks very much  
for the fix - good to know!

Best Wishes,  
Peter

---

<div class="post-metadata">

**Author:** ![darkstar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b487fb/32.png) [@darkstar](https://www.ruby-forum.com/u/darkstar)\
**Post date:** [August 3, 2011, 6:21pm UTC](https://www.ruby-forum.com/t/fyi-heroku-cedar-pg-openssl-omniauth-troubles-and-a-solution/210250/3 "2011-08-03T18:21:09Z")

</div>

On Wed, Aug 3, 2011 at 12:13 AM, Martin W.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> require ‘pg’  
> require ‘openssl’
> 
> This ensures that pg is required before openssl and all is good now.
> 
> Hope this helps others in similar situations.

MARTIN!!

Thank you - this is exactly the kind of thing that our mailing list is  
for.  
Thank you for demonstrating exemplarily citizenship.

Graciously yours,  
Curtis
