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

Closed
atle opened this Issue Jan 30, 2012 · 23 comments

Comments

Projects
None yet
@atle

atle commented Jan 30, 2012

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

This comment has been minimized.

Show comment Hide comment
@tenderlove

tenderlove Jan 30, 2012

Member

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

Member

tenderlove commented Jan 30, 2012

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

@atle

This comment has been minimized.

Show comment Hide comment
@atle

atle Jan 31, 2012

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?

atle commented Jan 31, 2012

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

This comment has been minimized.

Show comment Hide comment
@conradwt

conradwt Jan 31, 2012

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

https://gist.github.com/1709751

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

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

This comment has been minimized.

Show comment Hide comment
@arunagw

arunagw Jan 31, 2012

Member

I think @tenderlove means #1667

Member

arunagw commented Jan 31, 2012

I think @tenderlove means #1667

@atle

This comment has been minimized.

Show comment Hide comment
@atle

atle Jan 31, 2012

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

atle commented Jan 31, 2012

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

@tenderlove

This comment has been minimized.

Show comment Hide comment
@tenderlove

tenderlove Jan 31, 2012

Member

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

Member

tenderlove commented Jan 31, 2012

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

@atle

This comment has been minimized.

Show comment Hide comment
@atle

atle Jan 31, 2012

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

atle commented Jan 31, 2012

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

@tenderlove

This comment has been minimized.

Show comment Hide comment
@tenderlove

tenderlove Jan 31, 2012

Member

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!

Member

tenderlove commented Jan 31, 2012

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 Jan 31, 2012

@atle

This comment has been minimized.

Show comment Hide comment
@atle

atle Jan 31, 2012

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

atle commented Jan 31, 2012

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

This comment has been minimized.

Show comment Hide comment
@DonSchado

DonSchado Feb 13, 2012

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...

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

This comment has been minimized.

Show comment Hide comment
@hvillero

hvillero Feb 24, 2012

Thank you that worked

Thank you that worked

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Mar 27, 2012

Worked for me..thanks.

ghost commented Mar 27, 2012

Worked for me..thanks.

@robbandrew

This comment has been minimized.

Show comment Hide comment
@robbandrew

robbandrew Mar 27, 2012

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

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

@thierryu

This comment has been minimized.

Show comment Hide comment
@thierryu

thierryu May 2, 2012

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

thierryu commented May 2, 2012

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

@jpslav

This comment has been minimized.

Show comment Hide comment
@jpslav

jpslav May 9, 2012

Awesome. Thanks.

jpslav commented May 9, 2012

Awesome. Thanks.

@stereoscott

This comment has been minimized.

Show comment Hide comment
@stereoscott

stereoscott May 9, 2012

Contributor

@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.

Contributor

stereoscott commented May 9, 2012

@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

This comment has been minimized.

Show comment Hide comment
@cuzic4n

cuzic4n May 10, 2012

Removing https from Gemfile worked for me as well..

cuzic4n commented May 10, 2012

Removing https from Gemfile worked for me as well..

@nathania

This comment has been minimized.

Show comment Hide comment
@nathania

nathania May 14, 2012

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).

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).

@dakimaru

This comment has been minimized.

Show comment Hide comment
@dakimaru

dakimaru May 31, 2012

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!!!

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

This comment has been minimized.

Show comment Hide comment
@stefan-lz

stefan-lz Jun 3, 2012

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.

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

This comment has been minimized.

Show comment Hide comment
@conradwt

conradwt Jun 4, 2012

@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.

conradwt commented Jun 4, 2012

@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

This comment has been minimized.

Show comment Hide comment
@stefan-lz

stefan-lz Jun 10, 2012

@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, 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

This comment has been minimized.

Show comment Hide comment
@conradwt

conradwt Jun 10, 2012

@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.

@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

This comment has been minimized.

Show comment Hide comment
@HamedMP

HamedMP Jul 1, 2013

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!

HamedMP commented Jul 1, 2013

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