Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby 2.1.1 with RVM: Getting libyaml errors

I would like to use Ruby 2.1.1p76 and Rails 4.1.0beta1. I am getting some errors with RVM. I was using Ruby 2.0.0 and Rails 4.0.0. I upgraded to OS X Mavericks 10.9.2 and needed to reload everything.

Anyway, these are the commands I am running.

\curl -sSL https://get.rvm.io | bash -s stable --ruby

This installs successfully. Then I run this command to install rails.

sudo gem install rails

I get the following errors, says it is looking for libyaml.

/Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/yaml.rb:4: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.
/Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/psych.bundle, 9): Library not loaded: /usr/local/lib/libyaml-0.2.dylib (LoadError)
  Referenced from: /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/psych.bundle
  Reason: image not found - /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/psych.bundle
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:1:in `<top (required)>'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/yaml.rb:5:in `<top (required)>'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems.rb:616:in `load_yaml'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/config_file.rb:328:in `load_file'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/config_file.rb:197:in `initialize'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/gem_runner.rb:74:in `new'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/gem_runner.rb:74:in `do_configuration'
      from /Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/gem_runner.rb:39:in `run'
      from /Users/username/.rvm/rubies/ruby-2.1.1/bin/gem:21:in `<main>'

So, I run this command which is deprecated.

rvm pkg install libyaml

This gives me a deprecation warning and says to check out autolibs.

So I correct and verify both.

brew install libyaml
##
Warning: libyaml-0.1.4 already installed

more...

brew info libyaml
##
libyaml: stable 0.1.5 (bottled)
http://pyyaml.org/wiki/LibYAML
/usr/local/Cellar/libyaml/0.1.4 (7 files, 344K) *
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/libyaml.rb
==> Options
--universal

Install autolibs.

rvm get stable --autolibs=enable
rvm install ruby
rvm --default use ruby-2.1.1

Then, I get the same error.

Using /Users/username/.rvm/gems/ruby-2.1.1
/Users/username/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/yaml.rb:4: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.
like image 945
miler350 Avatar asked Dec 25 '22 11:12

miler350


1 Answers

brew unlink libyaml && brew link libyaml

https://github.com/wayneeseguin/rvm/issues/2689

like image 200
miler350 Avatar answered Jan 07 '23 16:01

miler350