Ruby keeps segfaulting when using the Koala gem to talk over HTTP:
/Users/pawel/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
I've tried the following:
Run which -a ruby which showed multiple Rubies via MacPorts. So I deleted those and running the same command again returns only /usr/bin/ruby
I've removed the MacPorts version of PostgreSQL and installed it with Homebrew instead (With MacPorts, it installs its own version of OpenSSL)
Running openssl version returns OpenSSL 1.0.0g 18 Jan 2012
I removed Ruby 1.9.3 from RVM and tried Luciano's method below which didn't work.
I've also tried reinstalling 1.9.3 from RVM and specifying --with-openssl-dir=/opt/local since which openssl returns /opt/local/bin/openssl
I've reinstalled RVM (It's now version 1.10.2 in /Users/pawel/.rvm/bin/rvm)
I've upgraded to Ruby 1.9.3-p125 and have also tried on 1.9.2
I've followed the instructions here: http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/ (which are my above steps, actually). I've also read Christopher's previous post here.
In my project directory when I run the following then I get the expected 0.:
ruby -rubygems -e" require 'eventmachine'; require 'openssl' "; echo $?
I've tried to sudo port -f deactivate openssl but then when I try to start a Rails server I get Library not loaded: /opt/local/lib/libssl.1.0.0.dylib
I need some more ideas on what else I can try, or things I've missed.
I'm also getting this same Segmentation Fault error, but I'm trying to list files on AWS-S3.
Edit:
This way worked for me:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.rvm/bin
rvm remove 1.9.3
rvm pkg install iconv
rvm pkg install openssl
rvm install ruby-1.9.3 --with-openssl-dir=~/.rvm/usr --with-iconv-dir=~/.rvm/usr
as #Simpleton said, I wrote a comment in the wrong place. Now I'm editing it with a response. ;-)
The problem seemed to be that Homebrew and MacPorts were conflicting, so I deleted MacPorts, removed all packages and the /opt/local/ directory. This caused some issue with the PG gem due to the PostgreSQL installation on Homebrew.
So I deleted the Postgres formula, then reinstalled it and ditto for the OpenSSL installation using Homebrew.
After that I imploded RVM and installed it and my Rubies again (not sure if this step was necessary) and finally it works.
I ran into this issue, too, but used a different solution. Here's the full stack trace of the error.
Here is the official bug report: http://bugs.ruby-lang.org/issues/6184 The responses below the stack trace were very helpful.
If you're using OS X's default openssl -> do like brew install
openssl and build with installed openssl, then try again.
If you're using openssl that installed by user -> build with OS X default ssl and try again.
This sounded similar to an issue for me recently when the readline library installed in MacPorts broke a ruby installation. Running the following script on the broken ruby installation showed it was loading the MacPorts openssl lib
require 'net/https'
puts `lsof -p #{$$} | grep ssl | awk '{print $9}'`
(the output)
/Users/john/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/openssl.bundle
/opt/local/lib/libssl.1.0.0.dylib
The solution was to temporarily move MacPorts out of /opt/local while installing ruby.
Quit all processes that are accessing MacPorts files. You can see which ones are running with sudo lsof | grep /opt/local.
sudo mv /opt/local /opt/localbak
Open a new terminal, then compile and install Ruby
sudo mv /opt/localbak /opt/local
After that, the ruby installation worked properly alongside MacPorts and did not load the libssl file from MacPorts.
Related
When I run
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl#3/3.0.1 rbenv install 3.1.0
I get this output:
Downloading ruby-3.1.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.gz
Installing ruby-3.1.0...
ruby-build: using readline from homebrew
BUILD FAILED (macOS 11.6.2 using ruby-build 20211227-3-gcdc215e)
Inspect or clean up the working tree at /var/folders/ts/k_8jb10136s3zw9k2k08nz3c0000gn/T/ruby-build.20220113093111.65052.FVpqjp
Results logged to /var/folders/ts/k_8jb10136s3zw9k2k08nz3c0000gn/T/ruby-build.20220113093111.65052.log
Last 10 log lines:
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/jeremy/.rbenv/versions/3.1.0
--enable-shared
--with-readline-dir=/usr/local/opt/readline
--with-openssl-dir=/usr/local/Cellar/openssl#3/3.0.1
CC=clang
LDFLAGS=-L/Users/jeremy/.rbenv/versions/3.1.0/lib
CPPFLAGS=-I/Users/jeremy/.rbenv/versions/3.1.0/include
I don't see any clues in the logs. I have tried lots of things like reinstalling rbenv and openssl, not specifying the configure opts, system updates, installing xcode, and more things from google. Maybe I am missing something.
Hi I also kept running into this on 'Mac OS X 10.15.7 using ruby-build' I had to set both of the following variables at the same time before the rbenv install 3.0.1 command:
OPENSSL_CFLAGS=-Wno-error=implicit-function-declaration RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 3.0.1
The first one tells the compiler to ignore where functions are implicitly declared rather than erroring out when this happens. And the second tells ruby which readline to use (in this case the one installed trough homebrew).
Ruby does not (yet) support OpenSSL 3.0. Implementing support for this newer version is tracked in https://github.com/ruby/openssl/issues/369
For now, you have to use Openssl 1.1 instead, which you can install with
brew install openssl#1.1
I am trying to install and set up my dev environment for RoR, on a Mac OSX Maverick 10.9.
After run the command:
$ rvm install ruby-2.0.0-p353
the following error out:
Installing required packages: libyaml, openssl.
Error running 'requirements_osx_brew_libs_install libyaml openssl',
showing last 15 lines of /Users/wlinares/.rvm/log/1388963243_ruby-2.0.0-p353/package_install_libyaml_openssl.log
esac;
return $ret
}
}
I downloaded libyaml from http://pyyaml.org/download/libyaml/ and installed following the default instructions.
Then I made the same for openssl so it was installed successfully under: /usr/lib/
Anyone has overcome this error? thanks!
You could try:
$ rvm install 2.0.0-p353 --autolibs=enable
After trying many tricks I could not overcome the issue, then I uninstalled everything and restart the process as a beginner I am. I decided to run the command.
$ gem install rails
then I installed gems:
$ gem install rubygems-update
and finally tested the environment with: rails new blog command.
Until here all seems to be working fine, but I am following the ruby guides in order to start coding my project. I don't have RVM now so I don't know how to handle with upgrades and versions.
That is my only problem, because I was told that Rails change frequently.
I would like to know now how to handle with upgrades including gems.
I feel like a compelte idiot, but I've been wrking on this all day and getting no where.
I've restarted several times trying to get a full install of Ruby on my OSX environment, RVM, Brew, Ruby: and every time I get through to the Ruby install it bottoms out on the rubygems install.
The reason I'm having to start again is that the RVM wouldn't update in Jewelerybox after my first successfull install (used a packaged all-in-one RubyInstaller) so I couldn't manage my gems - a problem caused by the initial Ruby install on the system living in the /usr/local and not under my own directory. To fix this I uninstalled all my Ruby stuff and started again.
All ok until the ruby compiler started gacking on the rubygems install section when installing ruby 2.0.0. Checking out the OSX system files under usr/bin I see that rubygems isn't there either (it should be present by default on OSX). Any ideas? (note that XCode is up to date and has command line tools installed)
Last attempt was:
$ rvm get head --autolibs=3 # get the latest RVM and build required libs
$ rvm requirements # just in case, install all other required stuff
$ rvm remove 2.0.0
$ rvm install ruby-2.0.0
. . . which fires the following error:
[2013-03-19 23:21:50] /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
Exception `LoadError' at /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1073 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1082 - cannot load such file -- rubygems/defaults/ruby
mkdir -p /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0
...
install -c -m 0755 /var/folders/nq/wkj89k854tl0w97n68qdn820pzk_51/T/gem.84634 /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/bin/gem
rm /var/folders/nq/wkj89k854tl0w97n68qdn820pzk_51/T/gem.84634
ERROR: While executing gem ... (NoMethodError)
undefined method `fu_stream_blksize' for #<Gem::Commands::SetupCommand:0x007ffd0e054818>
Installing RubyGems
Installing gem executable
I had the exact same error installing ruby v2 within rvm today. I was in a user account on Ubuntu who needed to use 'sudo' -- and enter my account password for sudo -- in order to install OS dependencies.
Your question mentions running rvm requirements to install dependencies. That seems to be new behavior in rvm, as of v1.19. It seemed to install a bunch of dependencies just fine. But then installing ruby bombed.
In earlier rvm versions, typing rvm requirements would just list the dependencies for rvm and for ruby, as in Archonic's answer.
I typed rvm implode and then started over with:
\curl -L https://get.rvm.io | bash -s 1.18.21
source /home/deploy/.rvm/scripts/rvm
rvm requirements
At that point I could install the libraries/tools that rvm said I needed for rvm and ruby, and then rvm install ruby-2.0.0-p0 succeeded.
I believe the issue is where RVM places your dependencies - global vs your user folder. From a book called "Agile development with rails":
First, you’ll need to make sure you have Xcode 3 or later installed...
$ xcodebuild -version
If you have Xcode version 3 installed, you’ll need to install the Git version control system separately. Verify your installation by running the following command:
$ git --version
Next, install RVM itself:
$ curl -L https://get.rvm.io | bash -s stable
Exit your command window or Terminal application and open a new one. This causes your .bash_login to be reloaded. Execute the following command, which provides additional installation instructions tailored to your specific operating system:
$ rvm requirements
Look for the line that tells you how to install the necessary OS dependencies for Ruby (MRI). Once you complete those instructions, you can proceed to install the Ruby interpreter itself:
$ rvm install 2.0.0
The preceding step will take a while as it downloads, configures, and compiles the necessary executables. Once it completes, use that environment, and install rails:
$ rvm use 2.0.0
$ gem install rails --version 4.0.0.beta1 --no-ri --no-rdoc
With the exception of the rvm use statement, each of the above instructions need only be done once. The rvm use statement needs to be repeated each time you open a shell window. The use keyword is optional, so you can abbreviate this to rvm 2.0.0. You can also choose to make it the default Ruby interpreter for new terminal sessions with the following command:
$ rvm --default 2.0.0
You can verify successful installation using the following command:
$ rails -v
If you have trouble, try the suggestions listed under the Troubleshooting Your Install heading on the rvm site.
Hope that does it for you!
This worked for me:
rvm get head
rvm requirements
rvm install ruby-2.0
I'm having a lot of trouble getting Ruby 1.8.7 installed on my clean install of Mountain Lion. I've looked around on Stack Overflow and don't see anything that specifically addresses this issue and hope that someone might have encountered this before.
I'm using the command line tools that can be downloaded with Xcode
I haven't had any problems installing Ruby 1.9.3 via RVM and HomeBrew. When I try to install 1.8.7 I get the following message after it tries to compile:
I first ran the command
rvm install 1.8.7
This gave me this error
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
After digging around a bit I tried
rvm install 1.8.7 --with-gcc=clang
Error running 'make ', please read /Users/paulzaich/.rvm/log/ruby-1.8.7-p370/make.log
There has been an error while running make. Halting the installation.
Ruby 'ruby-1.8.7-p370' was built using clang - but it's not (fully) supported, expect errors.
Please be aware that you just installed a ruby that requires 2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.
At this point I did some more searching and found something about needing compile my own readline. RVM Does Not Install Ruby 1.9.2 on Snow Leopard: 'Error running 'make '
This unfortunately seemed to corrupt my entire rvm install including 1.9.3. I tried to reinstall 1.9.3 and got the same errors I as I was getting with 1.8.7. I completely deleted RVM at this point and reinstalled. Had no problem installing 1.9.3 again.
I also tried updating all versions of rvm based off of this post RVM issue with Mountain Lion. No luck there either.
Update: I also tried using this walkthrough for REE 1.8.7 which recommended installing gcc-4.2. No luck unfortunately.
Update 2: I reference rvm requirements and installed the following packages
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
So far so good. Then I referenced this post on needing to reference the GCC compiler. I determined that the links referenced might not be correct because I'm using homebrew? I found the compiler in my Cellar folder and used the following command
CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7
No luck. Same error messages as before.
I just figured it out! Please reference this question on SO
rvm can no longer install 1.8.7-p352 on Mac OS X Mountain Lion
rvm reinstall 1.8.7 --without-tcl --without-tk
Alternatively, try this installation order if you have Homebrew.
brew install tcl-tk
rvm reinstall 1.8.7
Just to follow up to Paul's post. I'm running OSX 10.8.2, had 1.9.3 install without issues, but 1.8.7-p370 also failed. I symlinked gcc-4.2:
sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2
...successfully ran:
brew install tcl
...but tk failed:
brewk install tk
If you're in the same spot, this command did the trick:
CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7 --without-tk
Latest Xcode provides only clang - not GNU gcc, you need to install gcc-4.2 to be able to compile Ruby 1.8.7 properly, following command will show available options:
rvm requirements
currently only ruby 1.9.3-p125 and later has limited support for clang, but this is limited support, and still errors can be found.
I am new to Linux and Ruby. I have been searching for an answer but to no avail.
Using OpenSUSE 11.1
I recently downloaded the latest Ruby 1.9.2 and use the method make install from the source. I did not have the zlib back then.
Now, I cannot use the command "gem -d list ruby". The error says no such file to load -- zlib. I wanted to remove Ruby and RubyGem entirely from the system.
I tried using RVM but i couldn't figure it out on how to use. Been trying to install it for ages, but it is still useless, as the "type rvm | head -n1" comes out to rvm is hashed (usr/local/rvm/bin/rvm) even though I added the "[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session" to both .bash_profile and .bashrc.
Been working on it whole night. Any help is appreciated. Thanks in advance. :)
I had the exact same issue, installed Ruby 1.9.2 on openSUSE 11.4 using RVM. This was a clean install of openSUSE and I was trying to get a Rails development environment set up.
To address this, I removed my 1.9.2 instance using:
rvm uninstall 1.9.2
Then, I installed zlib-devel and openssl using:
sudo zypper install zlib-devel openssl
I then had to delete the 1.9.2 source files from rvm's src folder. This can be found under ~/.rvm/src
The source was there for ruby 1.9.2, rubygems, and yaml. I removed all three, leaving the ~/.rvm/src/rvm folder there in case it was needed by rvm.
Lastly, I re-installed ruby 1.9.2 using:
rvm install 1.9.2
Gems worked after that and I was able to do a gem update --system and gem install rails.
I hope this helps. I see this is an old, outstanding issue.
Mike