how to solve “ruby installation is missing psych” error?

后端 未结 30 3210
悲哀的现实
悲哀的现实 2020-11-28 17:54

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 s

相关标签:
30条回答
  • 2020-11-28 18:36

    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.

    0 讨论(0)
  • 2020-11-28 18:36

    On Solaris:

    # sudo crle -64 -l /usr/local/lib
    

    to add /usr/local/lib to the shared library search path (see man crle)

    0 讨论(0)
  • 2020-11-28 18:39

    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)
    
    0 讨论(0)
  • 2020-11-28 18:41

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

    0 讨论(0)
  • 2020-11-28 18:44
    $ brew doctor
    $ brew link libyaml
    
    0 讨论(0)
  • 2020-11-28 18:44

    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.

    0 讨论(0)
提交回复
热议问题