Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Segmentation fault when bundle install on Rails 3.2 on Ruby 1.9.3 #4766

Closed
atle opened this Issue · 23 comments
@atle

I have installed Ruby 1.9.3-p0 with RVM and Rails 3.2 into a new, empty gemset, when I try to create a new Rails app I get this:

rails new test32
...
create  vendor/plugins
create  vendor/plugins/.gitkeep
run  bundle install
/Users/atle/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
...

I use RVM version 1.10.2, Gem version 1.8.15 and OS X 10.7.2.

The same happens if I manually run bundle install after the app is created.
It is the same problem in both Rails 3.2.0 and 3.2.1.
If I use Ruby 1.9.2-p290 it works.
I currently use Rails 3.1.3 with Ruby 1.9.3-p0 and that works.

I saw someone else reported the same problem on the Rails 3.2.0 blog post, comment 21 at http://weblog.rubyonrails.org/2012/1/20/rails-3-2-0-faster-dev-mode-routing-explain-queries-tagged-logger-store.

@tenderlove
Owner

I think this is a duplicate of #1596. Can you take a look at that ticket?

@atle

I don't see any similarities, #1596 is about the need to put raw before esacape_javascript in Rails 3.1 RC3. Did you link to the wrong ticket?

@conradwt

I'm seeing the same thing when I try to create a Rails 3.2.1 application:

https://gist.github.com/1709751
@arunagw
Collaborator

I think @tenderlove means #1667

@atle

I don't understand, #1667 is about a bug in therubyracer gem, how can this be a duplicate of that issue?

@tenderlove
Owner

@atle in the Gemfile generated by rails, where it says https://rubygems.org, can you change that to http://rubygems.org?

@atle

@tenderlove that works! Thank you!
Is this caused by an error/misconfiguration on my computer? Since not everyone is affected by this issue?

@tenderlove
Owner

Oops, I mean issue 1596 on bundler. It's a problem with openssl and ruby, and it's documented on the ruby tracker here. I guess the solution is to install openssl from macports or something? Anyway, hope that helps!

@tenderlove tenderlove closed this
@atle

That helped alot, I got it working now.

First I installed OpenSSL through rvm

rvm pkg install openssl

Remove the existing Ruby 1.9.3 installation

rvm remove 1.9.3-p0

Install Ruby 1.9.3 again with a path to the new OpenSSL

rvm install 1.9.3-p0 -C -with-openssl-dir=~/.rvm/usr
@DonSchado

Apple deprecated the use of OpenSSL and replaced it by "common crypto".
I think we have to communicate that, cause it will be a PITA for many people...

@hvillero

Thank you that worked

@ghost

Worked for me..thanks.

@robbandrew

Just finished updating the MBP and came across this same problem, thanks for the update guys worked a treat.

@thierryu

Thank you! (installing ruby-1.9.3-p194 on Mac OS X 10.6).

@jpslav

Awesome. Thanks.

@stereoscott

@atle your comment above helped me with a clean installation of ruby 1.9.3 using rvm. i ran into the issue when i was setting up a new rails project (installing ruby-1.9.3-p194 on Mac OS 10.7.3). this got me around the "bundle install" command in rails that was segfaulting before. thank you.

@cuzic4n

Removing https from Gemfile worked for me as well..

@nathania

Thanks! @atle your instructions resolved the segmentation fault caused by running 'bundle install' in a new rails project (ruby-1.9.3-p194 on Mac OS 10.7.4).

@gothic1234

for my segfault I reinstalled ruby using this:
rvm install ruby-1.9.3 --with-openssl-dir=/opt/local --with-iconv-dir=/opt/local
and it worked!!!

@stefan-lz

Thanks for this fix, I ended up using:

CC=/opt/local/bin/gcc-apple-4.2 rvm install 1.9.3 -C -with-openssl-dir=~/.rvm/usr

which uses the MacPorts compiler, as my xcode doesn't compile ruby > 1.9 for some reason.

@conradwt

@stefan-lz I have been able to successfully compile 1.9.2-head, 1.9.3-head, and ruby-head using Xcode 4.3.2 by doing the following:

CC=clang rvm install 1.9.2-head
CC=clang rvm install 1.9.3-head
CC=clang rvm install ruby-head

Lastly, I installed all dependent libraries like openssl, libiconv, zlib, readline, libyaml, and so on through MacPorts.

@stefan-lz

@conradwt, just to let you know:

It turns out I was running x-code 4.2.1. So I updated to 4.3.2, and updated the 'command line tools' and ran

xcode-select -switch /Applications/Xcode.app/Contents/Developer

I also installed all the dependent libs though macports. Next I ran:

rvm get latest
CC=clang rvm install 1.9.3-head

But got the error: The provided CC(clang) is LLVM based, it is not yet fully supported by ruby and gems, please read 'rvm requirements'.

so instead I tried

rvm install 1.9.3-head

and it worked flawlessly, cheers.

@conradwt

@stefan-lz The message that you're seeing is a message generated by RVM. Also, the message is simply a warning message and not an error. I have been compiling from source using CC=clang with RVM for well over a year. Finally, this message is very misleading and should be removed because I can pull down the source trees for all ruby versions and manually build without issues using Clang.

@HamedMP

Excuse me, I got the same error my problem didn't solve by this!!
my "heroku logs" says:
{Slug compilation failed: failed to compile Ruby/Rails app}
and of course I get the same message when "git push heroku master":
{
Installing dependencies using
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
/usr/bin/env: ruby1.9.1: No such file or directory
Bundler Output: /usr/bin/env: ruby1.9.1: No such file or directory
!
! Failed to install gems via Bundler.
!

! Push rejected, failed to compile Ruby/Rails app

To git@heroku.com:savannah2013.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:savannah2013.git'
}
I try every thing users said in the blogs, stackoverflow and here, but none of them worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.