1

I tried to get rvm uninstalled in order to use rbenv on my Mac. Everything works fine until ruby comes into play..

when using

rbenv install 1.9.3-p194

it compiles it correctly, but after that I'd like to install bundler.. this produces the following error

computer:~ computer$ gem install bundler
/Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): mapping values are not allowed in this context at line 1 column 34 (Psych::SyntaxError)
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych.rb:151:in `parse'
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych.rb:127:in `load'
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/config_file.rb:253:in `load_file'
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/config_file.rb:191:in `initialize'
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/gem_runner.rb:78:in `new'
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/gem_runner.rb:78:in `do_configuration'
    from /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/gem_runner.rb:51:in `run'
    from /Users/computer/.rbenv/versions/1.9.3-p194/bin/gem:21:in `<main>'

I then tried to install an older version of ruby 1.9.3-p125.. but then even the build won't finish with a similar error that also relies on this psych interpreter... :(

computer-2:~ computer$ rbenv install 1.9.3-p125
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/computer/.rbenv/versions/1.9.3-p125
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz...
Installing ruby-1.9.3-p125...
Installed ruby-1.9.3-p125 to /Users/computer/.rbenv/versions/1.9.3-p125
Downloading http://production.cf.rubygems.org/rubygems/rubygems-1.8.23.tgz...
Installing rubygems-1.8.23...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/_9/tcqlf3c14l78vxtr600l9lqr0000gn/T/ruby-build.20120511162948.58105
Results logged to /var/folders/_9/tcqlf3c14l78vxtr600l9lqr0000gn/T/ruby-build.20120511162948.58105.log

Last 10 log lines:
/Users/computer/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych.rb:154:in `parse': (<unknown>): couldn't parse YAML at line 0 column 33 (Psych::SyntaxError)
    from /Users/computer/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych.rb:154:in `parse_stream'
    from /Users/computer/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych.rb:125:in `parse'
    from /Users/computer/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/psych.rb:112:in `load'
    from /private/var/folders/_9/tcqlf3c14l78vxtr600l9lqr0000gn/T/ruby-build.20120511162948.58105/rubygems-1.8.23/lib/rubygems/config_file.rb:253:in `load_file'
    from /private/var/folders/_9/tcqlf3c14l78vxtr600l9lqr0000gn/T/ruby-build.20120511162948.58105/rubygems-1.8.23/lib/rubygems/config_file.rb:191:in `initialize'
    from /private/var/folders/_9/tcqlf3c14l78vxtr600l9lqr0000gn/T/ruby-build.20120511162948.58105/rubygems-1.8.23/lib/rubygems/gem_runner.rb:78:in `new'
    from /private/var/folders/_9/tcqlf3c14l78vxtr600l9lqr0000gn/T/ruby-build.20120511162948.58105/rubygems-1.8.23/lib/rubygems/gem_runner.rb:78:in `do_configuration'
    from /private/var/folders/_9/tcqlf3c14l78vxtr600l9lqr0000gn/T/ruby-build.20120511162948.58105/rubygems-1.8.23/lib/rubygems/gem_runner.rb:51:in `run'
    from setup.rb:38:in `<main>'
computer-2:~ computer$ 

I wasn't able to find something on the net that had the same issues so I ask..

I tried those two resources that didn't help me as if the rbenv installer is doing this automatically

Installing libyaml for ruby on a mac osX (Lion)

Fixing the "ruby installation is missing psych" error?

Does anybody has a suggestion? Thanks in advance..

Community
  • 1
  • 1
pabera
  • 1,042
  • 1
  • 13
  • 22

4 Answers4

9

I've seen errors like this when I had a YAML syntax error in my .gemrc or .irbrc.

Check / remove them and try again.

Chris Keele
  • 3,364
  • 3
  • 30
  • 52
Mr. Ronald
  • 687
  • 4
  • 13
5

We had the same problem in our .gemrc. Removing .gemrc solved the problem. There were -- 2 dashes at the beginning of the file. Changing them to --- (3 dashes) and left the .gemrc in place. Then reinstalled 1.9.3p392 without any problems. Basically a YAML parser issue.

The complete .gemrc :

---
gem: --no-ri --no-rdoc

groky
  • 101
  • 1
  • 5
  • Same exact issue, only the dashes were at the top of our config.yaml. I didn't create the file, so I have no idea why they were there. – adam reed Jul 23 '14 at 17:47
  • Glad this was helpful. I haven't had the time to look into this indepth – groky Jul 30 '14 at 01:11
  • It occurred to me a few hours later - the dashes were in the file because of a source control conflict. A developer did not resolve his conflicts, so Git (in this case) added them. – adam reed Jul 31 '14 at 14:14
1

Change gem.rc file from

install: --no-rdoc --no-ri
update: --no-rdoc --no-rigem: --no-document

to

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
HandDisco
  • 627
  • 1
  • 6
  • 13
0
install: --no-rdoc --no-ri
update: --no-rdoc --no-rigem: --no-document

change to:

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
gem: --no-document

in order to keep option of Faster Gem Installation

Katarzyna
  • 1,712
  • 2
  • 11
  • 14