how to solve "ruby installation is missing psych" error? - ruby-on-rails

I used rvm to install ruby 1.9.3. even though it was successfully installed, it complained about libyaml. and now every time i wanna install a gem (say rails) this warning shows up:
It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.
I use Mac os X 10.7 (Lion).

In my case
rvm pkg install libyaml
and
rvm reinstall ruby-1.9.3-p125
solved the problem.
For people using Ubuntu, make sure that libtool is installed prior to the steps above:
sudo apt-get install libtool
For macOS users (with homebrew):
rm -rf /usr/local/lib/ruby/gems/ && brew reinstall ruby

brew install libyaml
rvm reinstall 1.9.3
Is what worked for me (on Snow Leopard).

for ubuntu and rvm
sudo apt-get install libtool
rvm pkg install libyaml
rvm reinstall 1.9.3
worked

If not using rvm, but rather you are building and installing ruby 1.9.3 from scratch — for example, you're managing your ruby versions with rbenv — you must install libyaml first. Get it from http://pyyaml.org/; at the moment, the file you want is http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz. Open the tarball and cd into the resulting folder. Then:
./configure --prefix=/usr/local
make
sudo make install
You are now ready to build ruby. Download ruby from http://ftp.ruby-lang.org/pub/ruby/. Open the tarball and cd into the resulting folder. Now:
./configure --prefix=/wherever/you/want/it/to/go
make
make install
(Or possibly sudo make install, depending on where you're putting it.) If using rbenv, you'll know it has worked if you switch to rbenv global 1.9.3-p194 (or whatever your version is called) and gem --version works without a warning. That worked for me on Mac OS X 10.6.8. (Update: I just tried this on Mac OS X 10.8.1 and it seems to have worked fine there too.)

In my case the solution was to add the psych gem to the Gemfile.

I had this problem. libyaml wouldn't compile. It turns out I was missing libtool.
yum install libtool
yum install libyaml (or rvm pkg install libyaml)
rvm reinstall 1.9.3
That solved my problem.

If you have installed ruby on macOS with homebrew, try this solution.
rm -rf /usr/local/lib/ruby/gems/ && brew reinstall ruby
Note that this will get rid of all installed gems. Best save a list of installed gems with gem list before you run this.

$ brew doctor
$ brew link libyaml

I reinstalled ruby 1.9.3 with libyaml support:
rvm reinstall 1.9.3 --with-libyaml
I made sure that I would use 1.9.3 before installing psych:
rvm use 1.9.3
I installed psych:
gem install psych

I got this fixed finally. The issue was that even though I installed libyaml with brew, it was never linked. I had to remove a conflicting header file and then brew link libyaml.

Installing ruby with rvm for mac osx, use autolibs to install libyaml and first uninstalling libyaml helps.
This worked for me:
brew uninstall libyaml
rvm autolibs enable
rvm reinstall ruby-2.1.1

I had the same problem (Lion 10.7.4), and fixed it by upgrading rvm then reinstalling ruby
1) upgrade rvm https://rvm.io//rvm/install/
curl -L https://get.rvm.io | bash -s stable --ruby
2) Then use rvm to reinstall ruby 1.9.3 (which had been previously installed with the earlier version of rvm)
rvm reinstall 1.9.3

sudo port install libyaml # or brew install libyaml
rvm get latest
rvm pkg install iconv
rvm pkg install openssl
rvm reinstall 1.9.3 --with-openssl-dir=~/.rvm/usr --with-iconv-dir=~/.rvm/usr
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
gem install linecache19-0.5.13.gem ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p125/
gem install ruby-debug19
rvm reload
reload your .rvmrc (cd out, cd in)
bundle

None of these answers worked for me.
I found my answer on https://github.com/sstephenson/ruby-build/issues/119
I am on Centos 6.3 Virtual Machine.
YOU MUST install libyaml before you install ruby. IF you ALREADY installed ruby you must get rid of the files before compiling source again!!!
# cd to your ruby source location
rm -rf /usr/local/lib/ruby # clean out ruby files
./configure
make && make install
gem -v # check if error is fixed

I built the libyaml files separately from source and installed them in /usr/local/lib. The ruby that RVM created still did not see them, and rather than muck with the makefile or the system LD_LIBRARY_PATH I just copied /usr/local/lib/libyaml* to ~/.rvm/rubies/ruby-1.9.3-p327/lib/
That quieted the warning.

This is what worked for me on Ubuntu:
- installing libyaml-dev (sudo apt-get install libyaml-dev)
- installing rvm + ruby 1.9.3

I tried all of these answers and still wasn't able to get it working. I installed libyaml with homebrew and then installed Ruby 1.9.3 and 2.0.0 with rvm. Each time it complained that I was missing psych (libyaml). But trying to install libyaml told me it was already installed. Rinse, repeat. Urgh.
Finally, what I did was to uninstall libyaml. Then I enabled autolibs in rvm, which (at least in OSX) allows rvm to install and manage dependencies more directly. Now when I installed the Rubies, rvm was able to install libyaml and recognize that it was in the right spot.
So if you've tried all of the other options, try actually removing libyaml and then installing your Rubies. It's count-intuitive from the error messages, but that's what finally worked for me.

I had the same problem (Cent OS 5.7), none of the above solutions worked to me.
// My console warning
/usr/local/rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
After doing several re-installs, I realized it's looking for yaml in ruby version of 1.9.1 instead of 1.9.3. So i downgraded
// obviously after installing `libyaml`
rvm remove all
rvm install 1.9.1
rvm use 1.9.1 --default
And it worked 8D!

On CentOS 6.3 none of the above worked. However installing libyaml from source before installing ruby resolved the problem.
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
$ tar xzvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
and then
rvm install 1.9.3
gem install rails

I'm using
rvm 1.16.20 (version) by Wayne E. Seguin ,
Michal Papis [https://rvm.io/]
and also got the following error during bundle install
.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `': It seems
your ruby installation is missing psych (for YAML output). To
eliminate this warning, please install libyaml and reinstall your
ruby.
Here are three different ways to resolve this error w/o having to gem install psych
export LD_LIBRARY_PATH=/usr/local/lib
alter /etc/ld.so.conf
sudo su - root
echo /usr/local/lib64 >> /etc/ld.so.conf
echo /usr/local/lib >> /etc/ld.so.conf
ldconfig
Fix rvm ruby 1.9.3 installation via
patch .rvm/scripts/functions/manage/ruby < ruby-1.9.3-LDFLAGS.patch
rvm uninstall ruby-1.9.3-p194
export LDFLAGS='-L /usr/local/lib64 -L/usr/local/lib -Xlinker -R/usr/local/lib64 -Xlinker -R/usr/local/lib'
rvm install ruby-1.9.3-p194 --disable-binary
grep configure_args .rvm/src/ruby-1.9.3-p194/config.log # to confirm LDFLAG
$ diff -c .rvm/{src/rvm/,}scripts/functions/manage/ruby
*** .rvm/src/rvm/scripts/functions/manage/ruby 2012-11-10 06:28:14.000000000 +0000
--- .rvm/scripts/functions/manage/ruby 2013-01-25 17:18:00.000000000 +0000
***************
*** 106,123 ****
# when relative is in effect libyaml is installed in ruby itself so it will be moved with ruby
prefix_path="${rvm_rubies_path}/${rvm_ruby_string}" libyaml
! __rvm_update_configure_env CFLAGS="-I${rvm_rubies_path}/${rvm_ruby_string}/include"
! __rvm_update_configure_env LDFLAGS="-L${rvm_rubies_path}/${rvm_ruby_string}/lib"
if [[ -d "${rvm_rubies_path}/${rvm_ruby_string}/lib64" ]]
! then __rvm_update_configure_env LDFLAGS="-L${rvm_rubies_path}/${rvm_ruby_string}/lib64"
fi
else
libyaml_installed || libyaml # Installs libyaml
! __rvm_update_configure_env CFLAGS="-I${rvm_path}/usr/include"
! __rvm_update_configure_env LDFLAGS="-L${rvm_path}/usr/lib"
if [[ -d "${rvm_path}/usr/lib64" ]]
! then __rvm_update_configure_env LDFLAGS="-L${rvm_path}/usr/lib64"
fi
fi
--- 106,123 ----
# when relative is in effect libyaml is installed in ruby itself so it will be moved with ruby
prefix_path="${rvm_rubies_path}/${rvm_ruby_string}" libyaml
! __rvm_update_configure_env CFLAGS="-I${rvm_rubies_path}/${rvm_ruby_string}/include ${CFLAGS}"
! __rvm_update_configure_env LDFLAGS="-L${rvm_rubies_path}/${rvm_ruby_string}/lib ${LDFLAGS}"
if [[ -d "${rvm_rubies_path}/${rvm_ruby_string}/lib64" ]]
! then __rvm_update_configure_env LDFLAGS="-L${rvm_rubies_path}/${rvm_ruby_string}/lib64 ${LDFLAGS}"
fi
else
libyaml_installed || libyaml # Installs libyaml
! __rvm_update_configure_env CFLAGS="-I${rvm_path}/usr/include ${CFLAGS}"
! __rvm_update_configure_env LDFLAGS="-L${rvm_path}/usr/lib ${LDFLAGS}"
if [[ -d "${rvm_path}/usr/lib64" ]]
! then __rvm_update_configure_env LDFLAGS="-L${rvm_path}/usr/lib64 ${LDFLAGS}"
fi
fi

I also struggled with the same failures with rvm install ruby-2.0.0 for many, MANY hours. I had tried all the different methods to install libyaml; wget source, yum and rvm. I also tried all of the different approaches listed in similar threads. Because I tried all the different methods, I had multiple installations and locations of libyaml.
RVM is perfectly capable of installing the necessary dependencies in ~/.rvm. Simply removing the libyaml files from non-RVM install fixed this issue for me:
sudo rm /usr/local/lib/libyaml*.*
rvm reinstall ruby-2.0.0-p0
Works!

NON-RVM ruby install method.
% uname -a
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
% cat /etc/redhat-release
CentOS release 6.4 (Final)
% wget http://apt.sw.be/redhat/el5/en/x86_64/dag/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
% sudo rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm"
% sudo rpm -ivh rpmforge-release-0.3.6-1.el5.rf.*.rpm"
DISABLE rpmforge by editing this file and set enabled=0
% sudo vi /etc/yum.repos.d/rpmforge.repo
% grep rpmforge ~/.aliases
alias rpmforge "sudo yum --disablerepo='*' --enablerepo='rpmforge'"
% rpmforge install libyaml libyaml-devel
% sudo yum list installed | grep libyaml
libyaml.x86_64 0.1.4-1.el5.rf #rpmforge
libyaml-devel.x86_64 0.1.4-1.el5.rf #rpmforge
The libyaml-devel is the key.
% tar zxvf ruby-1.9.3-p448.tar.gz
% cd ruby-1.9.3-p448
% ./configure -prefix=$HOME/ruby-1.9.3-p448
% make ; make install
% cd $HOME; ln -s ./ruby-1.9.3-p448 ruby
Update your path and source .cshrc
% echo $PATH
/home/francis/ruby/bin:/usr/sbin:/home/francis/bin:/home/francis/jdk1.7.0_25/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin
% which ruby
/home/francis/ruby/bin/ruby
% gem update --system
Set your GEM_HOME in .cshrc and source
% echo $GEM_HOME
% /home/francis/ruby/lib/ruby/gems
% gem install mysql2 pg ruby-debug-ide rails capistrano capistrano-ext passenger

If you are building ruby from source (I built 1.9.3 on Fedora 20), you will need this before you do the configure/make to build ruby:
yum install libyaml-devel
(in addition to yum install libyaml.) Similar to Francis's answer using rpmforge above.

I was having this error and noticed I had different versions of Ruby installed with HomeBrew, along with many gems that I no longer used. So did a full clean up like this:
$ brew remove --force ruby # remove all versions installed
$ sudo rm -rf /usr/local/lib/ruby # remove all gems and leftover files
$ brew install ruby
$ gem install bundler
$ bundle install
If you don't use a Gemfile, make sure you know which gems to reinstall.

In my case all I needed to do was
rm -rf /usr/local/lib/ruby/gems/2.4.0/gems/psych-2.2.4
rm -rf /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0/psych-2.2.4
Now, FWIW, gem list includes
psych (2.2.4, default: 2.2.2)

Ubuntu
Using RVM
Reason: Conflicting Psych gem versions between ruby 2.4.4 and ruby 2.5.1
I spent a few hours trying to get my error to go away and none of the replies here suited my case, so I thought I would post how I solved it...
In my case when I ran gem list | grep psych, I had the following output: psych(default: 3.1.0, default: 3.0.2).
Apparently since version 2.5.0, ruby depends on the newer version of psych (3.1.0) and having both set as default was messing up everything. Notice that I never ended up finding out why those were both set as default - I completely wiped out rvm and ruby versions from my computer due to this.
So in order to remove the older version (3.0.2) from being set as default, head to ~/.rvm/gems/ruby-x.x.x#global/specifications/default. If you run ls | grep psych it will return both versions of the gem here. If you want to maintain 3.1.0 as default just run mv psych-3.0.2.gemspec ../ and then try running gemlist to make sure it is listing only one version as default now...
tl;dr
cd /.rvm/gems/ruby-x.x.x#global/specifications/default
mv psych-3.0.2 ../
Hope this helps someone!

On Snow Leopard, the solution by Catharz did not work for me. This solution, however, did:
brew install libyaml
rvm get head
rvm reinstall 1.9.3 --with-gcc=clang
(The rvm reinstall gave me a warning about clang not having the option "--with-libyaml" but it solved the error message regardless.)

This worked for me at least on Ubuntu 10.04
$ sudo apt-get install libtool
$ rvm reinstall 1.9.3

On Solaris:
# sudo crle -64 -l /usr/local/lib
to add /usr/local/lib to the shared library search path
(see man crle)

When I switch from 64 bit to 32 bit on Snow Leopard 10.6.8, I had reinstalled ruby (used rvm) to run on 32bit and met the same problem. So I just 'cleanup' all thing that cached by rvm before and problems solved. Hope this tip can help someone.
rvm cleanup all
rvm install ruby_version_here //(This way, rvm will also re-download newest yaml).
BTW, if you still meet this problem, I think you can try:
gem install psych

Related

rbenv: no such command "install" even though ruby-build is installed

I'm trying to get ruby 2.1.4 installed via rbenv for a client project.
Though previously I've been able to install ruby versions through rbenv, after upgrading to Yosemite, I keep getting the following error:
rbenv: no such command 'install'
After digging around, I saw lots of tips about how "install" comes from the ruby-build plugin, which is installed via homebrew:
which ruby-build
/usr/local/bin/ruby-build
I installed rbenv via Homebrew, but when I try use which rbenv, I get:
rbenv () {
typeset command
command="$1"
if [ "$#" -gt 0 ]
then
shift
fi
case "$command" in
(rehash|shell) eval `rbenv "sh-$command" "$#"` ;;
(*) command rbenv "$command" "$#" ;;
esac
}
I have run brew update and brew upgrade rbenv ruby-builder, and it tells me everything is up to date.
Below is my full $PATH:
zsh: no such file or directory: /usr/local/var/rbenv/shims:/usr/local/var/rbenv/shims:/usr/local/bin:/usr/local/sbin:/Users/dannycox/.rbenv/shims:/Users/dannycox/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Users/dannycox/.rbenv/shims:/Users/dannycox/.rbenv/bin
UPDATE: Found another answer with a little deeper digging on github that showed signs of promise, but failed to solve the issue with rbenv. https://github.com/sstephenson/rbenv/issues/610#issuecomment-56240018
I believe 2.1.4 is now installed on my machine, but it installed here:
Successfully installed ruby 2.1.4 into /Users/dannycox/.rubies/ruby-2.1.4
As a result, my bundler won't work with the new ruby 2.0 version and I get the following error when I try to gem install bundle:
Fetching: bundler-1.7.6.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory
Still need help to identify why ruby-build isn't playing nice with rbenv...
Make sure to install optional step 5 in the instructions:
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
Install ruby-build, which provides the rbenv install command that simplifies the process of installing new Ruby versions.
I had similar problem, and trace the problem to ruby-build. So i updated the homebrew and reinstall the ruby-build
> brew update
> brew reinstall ruby-build
Find the ruby version
> brew ls -v ruby-build | grep 2.1.4
then install intended version ruby again
> rbenv install 2.1.4
From your perms error I think you are trying to install to the system ruby, which is the one that comes with Apple OSX. You want to use rbenv to install your own ruby and install gems into that.
Read - https://github.com/rbenv/ruby-build#readme
And use the
rbenv versions
command to show what instance of ruby you are about to install the gems into. If it's system then you need to install your own ruby instance and then use that ruby for gems.

Unable to require openssl when initialling rails

I have the error below when installing rails on osx maverick. OpenSSL has been installed already. Does anyone know how to fix this issue?
$ gem install rails
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
You may need to update your OpenSSL CA Bundle, per these instructions from chruby about Ruby 2.1.2 which state:
Install 2.1.2
Note: MRI 2.1.2 requires OpenSSL >= 1.0.1.
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2
tar -xjvf ruby-2.1.2.tar.bz2
cd ruby-2.1.2
./configure --prefix=/opt/rubies/ruby-2.1.2
make
sudo make install
Note: OS X users must update their OpenSSL CA cert bundle and properly set ./configure --with-opt-dir to compile against Homebrew's libraries:
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2
tar -xjvf ruby-2.1.2.tar.bz2
cd ruby-2.1.2
./configure --prefix="$HOME/.rubies/ruby-2.1.2" --with-opt-dir="$(brew --prefix openssl):$(brew --prefix readline):$(brew --prefix libyaml):$(brew --prefix gdbm):$(brew --prefix libffi)"
make
sudo make install
For me, it was enough to just update my OpenSSL CA cert bundle via Homebrew and then reinstall Ruby using ruby-install
brew tap raggi/ale
brew install openssl-osx-ca
ruby-install ruby 2.1.2
After I performed the above steps, the issue stopped presenting itself.
For me... I had tried installing ruby 2.1.2 with ruby-install (since I use chruby for my ruby version manager). I had tried manually installing openssl with homebrew, etc. But I still couldn't get ruby-install to successfully build ruby 2.1.2. I've also had similar issues in the past with installing rubies and ruby-build worked then so I gave I gave it a shot here and it worked! As I understand it, ruby-build is the installer used by rbenv.
What I did was:
rm -rf ~/.rubies/ruby-2.1.2 (This is where my ruby installs are installed at.)
brew remove --force openssl
brew install ruby-build
restart console to be safe
ruby-build 2.1.2 ~/.rubies/ruby-2.1.2
And success! ruby-build seems to be much smarter than ruby-install at successfully installing weird dependencies. I'm done with ruby-install at this point -- it's given me too many problems! (brew remove --force ruby-install)
I've had a similar issue.
A fix to rvm was introduced just yesterday, and it was not yet merged with rvm master branch, so this is how you do it:
rvm get branch /bugfix/3923_set_osx_brew_openssl_compiler_config
rvm install 2.4.0
gem install rails
If that works for you, go to the issue and tell the developer how much you appreciate his effort:
Recently I was struggling with ruby installations due to the recent auto-update in openssl version from 1.0 to 1.1.
I found out that the ruby version < 2.4 does not work with openssl version > 1.0.
I was not even able to revert back the openssl to 1.0 version because other libs has dependencies on it.
No other solution except the one given below worked for me:
brew install rbenv/tap/openssl#1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl#1.0'
gem update --system
Now my ruby runs with openssl 1.0 whereas all other libraries are running on the default openssl version 1.1.
secure server is the reason of this issue. You can Install it by using this command:
gem install rails --source http://rubygems.org
by default its using https://rubygem.org as the source for the gem.
$ gem install rails ERROR: While executing gem ... (Gem::Exception) Unable to
require openssl, install OpenSSL and
rebuild ruby (preferred) or use non-HTTPS sources
so we can specify a source, http//:rubygems.org which is a non-HTTPS source.

Please install libyaml and reinstall your ruby

libyaml warning doesn't go away, even if you install libyaml
gem install bundler
/home/ec2-user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Fetching: bundler-1.3.4.gem (100%)
Successfully installed bundler-1.3.4
First remove any previous docs of yaml by
cd .rvm/src
sudo rm -rf yaml*
Then you can do rest of the install by -
rvm pkg install libyaml
P.S You will need to reinstall ruby after this.
UPDATE: If rvm pkg seems to be deprecated. You can compile a source on your own. All you
gotta do is download the latest version of libyaml from http://pyyaml.org/download/libyaml/
tar zxf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make
make install
UPDATE2: BTW, you could still use rvm pkg and/or when reinstalling ruby make sure to enbale autolibs by
\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable
A friend of mine had a similar problem on his mac.
brew install libyaml
ended up working for us and we were able to avoid a reinstall of ruby.
If using homebrew, a temporary fix that worked for me was to run:
brew unlink libyaml && brew link libyaml
plus you may also need to run:
brew unlink openssl && brew link --force openssl
See this issue thread for more details: https://github.com/wayneeseguin/rvm/issues/2689

cannot load such file -- openssl (LoadError)

In OS X in rvm how do I check if openssl is configured properly?
I get the cannot load such file -- openssl (LoadError)
And I have tried everything in Rails 3 - no such file to load -- openssl with no success.
Check what rubies are installed:
rvm list
Then make sure to use one of the installed rubies:
rvm use 1.9.3-p327
And test if openssl is available:
ruby -ropenssl -e "puts :OK"
It will print OK if openssl is enabled, otherwise you will get exception
In case of exception =>
UPDATE:
new version of rvm has improved automation support:
rvm get stable
rvm autolibs enable
rvm reinstall all --force
OLD:
run:
rvm requirements run force
rvm pkg remove
Followed by:
rvm reinstall all --force
This instruction is not OSX specific, it will work on all platforms, although on OSX it will work best with HomeBrew, when it's not installed only list of required software will be shown and you need to install it manually.
Many years later, the solution is changed because of brew upgrading, this works now:
# pull full brew git repo
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
# generate new brew tap repo
brew tap-new $USER/old-openssl
# extract openssl 1.0.2t forumlar to $USER/old-openssl
brew extract --version=1.0.2t openssl $USER/old-openssl
# install old openssl from $USER/old-openssl repo
brew install openssl#1.0.2t
# reinstall ruby
rvm reinstall 2.3.4 --with-openssl-dir=`brew --prefix openssl#1.0.2t`
Try this.
rvm install ruby-2.0.0-preview1 --with-openssl-dir=$HOME/.rvm/usr --verify-downloads 1
This help me :
https://gist.github.com/Irio/1496746
$ rvm pkg install openssl
$ rvm remove 1.9.3
$ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
I uninstalled everything (rvm, rails, ruby, etc) on my macbook.
Installed homebrew
Installed rvm
Ran rvm requirements run force
Ran rvm install rails
rails new sample_app
cd sample_app
Note: source 'https://rubygems.org' is present in Gemfile, openssl is required!
bundle install and it worked!
No need to specify: --with-openssl-dir=$HOME/.rvm/usr
To resolve this, install openssl (preferably using brew).
Update Xcode to the latest version and enable command line installations using it.
Reinstall rvm using
rvm reinstall all
Note that rvm reinstall all --force
will delete all your previous installations of binaries/pkgs done using rvm.
Assuming ruby is already installed, do the following:
rvm cleanup all
rvm reinstall all --force
I got the same error, and the error was fixed by opening new terminal session.
I am using frum ruby version manager.
gem install openssl
worked for me, but nothing has declared depending on the openssl, its weired
Following command solved my issue
note 2.3.4 is the ruby version I am using, change as per your requirements
rvm reinstall 2.3.4 --with-openssl-dir=$rvm_path/usr
Make sure that $rvm_path is properly set, with command echo $rvm_path. If this path is empty, check if your home folder has .rvm folder.
In this case use
rvm reinstall 2.3.4 --with-openssl-dir=~/.rvm/usr

Install RoR on debian Squeeze

is there any way to install Ruby 1.9.2 or 1.8.7 + Rails 3 on my debian squeeze?
You probably don't want to use RVM on a production machine. Its $PATH magic will break in non-obvious places (e.g. cron jobs), and you'll be up a creek.
You could simply build from sources and use checkinstall to create a .deb for yourself. Here's a tutorial for Ubuntu that should translate pretty well into debian.
First install rubygems, I think it's the only Debian package. Then (as Ruby gems):
rvm (install with it ruby 1.9.2, or Ruby version you want)
bundler
rails
And then you can manage application gems with Bundler.
Have you looked at railsready-debian-lenny (it is claimed to work on Squeeze too)? Don't forget to install dependencies pointed in readme.md
The steps below outlines installing Ruby On Rails as a normal user.
Check first if the user has sudo rights. To do this try executing a simple command
$sudo ls -a
[sudo] password for unlimit:
unlimit is not in the sudoers file. This incident will be reported.
If you see a message like above, you will need to add the user to the sudoer file, this can be done by
$echo 'unlimit ALL=(ALL) ALL' >> /etc/sudoers
Check if you have ruby installed. Execute the command below
$ruby -v
-[bash]: ruby:command not found
If you see something like this, this means ruby is not installed. Install it
$sudo apt-get install ruby
Install additional libraries
$sudo apt-get install build-essential
$sudo apt-get install curl
$sudo apt-get install libssl-dev
Install rvm
$curl -L get.rvm.io | bash -s stable
Set the rvm path
$source $HOME/.rvm/scripts/rvm
You should add this to the .bashrc file.
Fetch the latest rvm and reload it
$rvm get head && rvm reload
Install ruby 1.9.3
$rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm.usr
I needed to install the readline lib
$sudo apt-get install libreadline-dev
Get the rails gem
$gem install rails -v 3.2.3
Check if you have rails
$rails -v
Rails 3.2.3
Get the readline package
$rvm pkg install readline
Get sqlite3
$sudo apt-get install sqlite3 libsqlite3-dev
You are all set to create your first rails app
$rails new app HelloWorld
You can find more info http://unlimit.in/installing-ruby-on-rails-on-debian.html
The best way to install Ruby and any Gems you like is with RVM. It will compile the latest version of Ruby for you and give you tools to manage gemsets.
Relying on the distribution's packages is usually a bad idea, because they are typically out-of-date.

Resources