{"id":991,"date":"2012-06-29T20:15:32","date_gmt":"2012-06-30T04:15:32","guid":{"rendered":"http:\/\/www.wiredatom.com\/blog\/?p=991"},"modified":"2013-02-22T22:18:20","modified_gmt":"2013-02-23T06:18:20","slug":"segmentation-fault-with-rails-3-2-6-on-osx","status":"publish","type":"post","link":"https:\/\/www.wiredatom.com\/blog\/2012\/06\/29\/segmentation-fault-with-rails-3-2-6-on-osx\/","title":{"rendered":"Segmentation Fault with Rails 3.2.6 on OSX"},"content":{"rendered":"<p>I was trying to create a new project with Rails 3.2.x. But every time as it runs <code class=\"codecolorer bash default\"><span class=\"bash\">bundle <span class=\"kw2\">install<\/span><\/span><\/code>, I get the following error:<\/p>\n<div class=\"codecolorer-container bash railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"sy0\">\/<\/span>Users<span class=\"sy0\">\/<\/span>home_dir<span class=\"sy0\">\/<\/span>.rvm<span class=\"sy0\">\/<\/span>rubies<span class=\"sy0\">\/<\/span>ruby-1.9.3-p194<span class=\"sy0\">\/<\/span>lib<span class=\"sy0\">\/<\/span>ruby<span class=\"sy0\">\/<\/span>1.9.1<span class=\"sy0\">\/<\/span>net<span class=\"sy0\">\/<\/span>http.rb:<span class=\"nu0\">799<\/span>: <span class=\"br0\">&#91;<\/span>BUG<span class=\"br0\">&#93;<\/span> Segmentation fault<br \/>\nruby 1.9.3p194 <span class=\"br0\">&#40;<\/span><span class=\"nu0\">2012<\/span>-04-<span class=\"nu0\">20<\/span> revision <span class=\"nu0\">35410<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#91;<\/span>x86_64-darwin11.4.0<span class=\"br0\">&#93;<\/span><br \/>\n.<br \/>\n.<br \/>\n.<br \/>\nother crap<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>I tried <code class=\"codecolorer bash default\"><span class=\"bash\">gem uninstall<\/span><\/code> and reinstalling Rails to no avail. It turns out that Ruby needs to find openssl but couldn&#8217;t find it at its preferred location. MacPorts handled all my 3rd party binary needs. But in this case, I wanted to use RVM to handle those packages for dependency reasons.<\/p>\n<div class=\"codecolorer-container bash railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/><\/div><\/td><td><div class=\"bash codecolorer\">rvm pkg <span class=\"kw2\">install<\/span> iconv<br \/>\nrvm pkg <span class=\"kw2\">install<\/span> openssl<br \/>\nrvm reinstall 1.9.3 <span class=\"re5\">--with-openssl-dir<\/span>=~<span class=\"sy0\">\/<\/span>.rvm<span class=\"sy0\">\/<\/span>usr <span class=\"re5\">--with-iconv-dir<\/span>=~<span class=\"sy0\">\/<\/span>.rvm<span class=\"sy0\">\/<\/span>usr<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>And that solved the issue for me.<\/p>\n<p><strong>Update 02\/22\/2013:<\/strong> The lastest version of <code class=\"codecolorer bash default\"><span class=\"bash\">rvm 1.18.10<\/span><\/code> apparently will do all kinds of nice things in the background for you to solve the issue as well.<\/p>\n<p>References:<\/p>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/9345622\/error-running-bundle-install-using-ruby-1-9-3\">Error running &#8216;bundle install&#8217; using Ruby 1.9.3<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/9136694\/rails-gemfile-defaults-to-https-bundle-install-fails\">Rails Gemfile defaults to &#8216;https&#8217; &#8211; &#8216;bundle install&#8217; fails<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I was trying to create a new project with Rails 3.2.x. But every time as it runs bundle install, I get the following error: 123456\/Users\/home_dir\/.rvm\/rubies\/ruby-1.9.3-p194\/lib\/ruby\/1.9.1\/net\/http.rb:799: &#91;BUG&#93; Segmentation fault ruby 1.9.3p194 &#40;2012-04-20 revision 35410&#41; &#91;x86_64-darwin11.4.0&#93; . . . other crap I tried gem uninstall and reinstalling Rails to no avail. It turns out that Ruby needs &hellip; <a href=\"https:\/\/www.wiredatom.com\/blog\/2012\/06\/29\/segmentation-fault-with-rails-3-2-6-on-osx\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Segmentation Fault with Rails 3.2.6 on OSX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21,10,3],"tags":[],"class_list":["post-991","post","type-post","status-publish","format-standard","hentry","category-coding","category-geek-stuff","category-mac-osx"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p54IqZ-fZ","_links":{"self":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/comments?post=991"}],"version-history":[{"count":1,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/991\/revisions"}],"predecessor-version":[{"id":1007,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/991\/revisions\/1007"}],"wp:attachment":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/media?parent=991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/categories?post=991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/tags?post=991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}