Programing

"루비 설치에 정신이 없습니다"오류를 해결하는 방법?

lottogame 2020. 6. 5. 08:01
반응형

"루비 설치에 정신이 없습니다"오류를 해결하는 방법?


rvm을 사용하여 루비 1.9.3을 설치했습니다. 성공적으로 설치되었지만 libyaml에 대해 불평했습니다. 이제 보석 (예 : 레일)을 설치하려고 할 때 마다이 경고가 나타납니다.

It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.

Mac OS X 10.7 (Lion)을 사용합니다.


나의 경우에는

rvm pkg install libyaml

rvm reinstall ruby-1.9.3-p125

문제를 해결했다.

Ubuntu를 사용하는 사람들 libtool은 위의 단계 전에 설치 해야합니다 .

sudo apt-get install libtool

macOS 사용자 (homebrew 포함) :

rm -rf /usr/local/lib/ruby/gems/ && brew reinstall ruby

우분투와 rvm

sudo apt-get install libtool
rvm pkg install libyaml
rvm reinstall 1.9.3

일했다


rvm을 사용하지 않고 처음부터 ruby ​​1.9.3을 빌드하고 설치하는 경우 (예 : rbenv로 루비 버전을 관리하는 경우) 먼저 libyaml을 설치해야합니다. http://pyyaml.org/ 에서 가져 오십시오 . 현재 원하는 파일은 http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz 입니다. tarball을 열고 결과 폴더로 cd하십시오. 그때:

./configure --prefix=/usr/local
make
sudo make install

이제 루비를 만들 준비가되었습니다. http://ftp.ruby-lang.org/pub/ruby/ 에서 루비를 다운로드 하십시오 . tarball을 열고 결과 폴더로 cd하십시오. 지금:

./configure --prefix=/wherever/you/want/it/to/go
make
make install

(또는 아마도 sudo make install, 당신이 그것을 옮기고 위치에 따라.) rbenv를 사용하는 경우, 당신은 당신이로 전환 할 경우이 근무하고있다 알 rbenv global 1.9.3-p194(또는 어떤 버전이 호출) 및 gem --version경고없이 작동합니다. 그것은 Mac OS X 10.6.8에서 효과적이었습니다. ( 업데이트 : Mac OS X 10.8.1에서 방금 시도한 결과 제대로 작동하는 것 같습니다.)


brew install libyaml
rvm reinstall 1.9.3

나를 위해 일한 것입니까 (Snow Leopard에서).


필자의 경우 해결책은 psychgem을 Gemfile 에 추가하는 것이 었습니다.


나는이 문제가 있었다. libyaml이 컴파일되지 않습니다. libtool이 누락 된 것으로 나타났습니다.

yum install libtool
yum install libyaml (or rvm pkg install libyaml)
rvm reinstall 1.9.3

그게 내 문제를 해결했다.


$ brew doctor
$ brew link libyaml

나는 이것을 마침내 고쳤다. 문제는 brew와 함께 libyaml을 설치했지만 연결되지 않았다는 것입니다. 나는 그 충돌하는 헤더 파일을 제거했다 brew link libyaml.


homebrew를 사용하여 macOS에 ruby를 설치 한 경우이 솔루션을 사용해보십시오 .

rm -rf /usr/local/lib/ruby/gems/ && brew reinstall ruby

이것은 설치된 모든 gem을 제거합니다. 설치 gem list하기 전에 설치된 gem 목록을 저장하는 것이 가장 좋습니다.


나는 같은 문제 (Lion 10.7.4)가 있었고 rvm을 업그레이드 한 다음 루비를 다시 설치하여 문제를 해결했습니다.

1) rvm https://rvm.io//rvm/install/ 업그레이드

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

2) 그런 다음 rvm을 사용하여 이전 버전의 rvm과 함께 설치된 ruby ​​1.9.3을 다시 설치하십시오.

rvm reinstall 1.9.3

libyaml을 지원하는 ruby ​​1.9.3을 다시 설치했습니다.

rvm reinstall 1.9.3 --with-libyaml

psych을 설치하기 전에 1.9.3을 사용하는지 확인했습니다.

rvm use 1.9.3

나는 정신병자를 설치했다.

gem install psych

Mac OSX 용 rvm으로 ruby를 설치하려면 autolibs를 사용하여 libyaml을 설치하고 먼저 libyaml을 제거하십시오.

이것은 나를 위해 일했다 :

brew uninstall libyaml
rvm autolibs enable
rvm reinstall ruby-2.1.1

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

.rvmrc를 다시로드하십시오 (cd out, cd in)

bundle

이 답변들 중 어느 것도 나를 위해 일하지 않았습니다.

https://github.com/sstephenson/ruby-build/issues/119 에서 내 대답을 찾았습니다 . Centos 6.3 가상 머신에 있습니다.

루비를 설치하기 전에 반드시 libyaml을 설치해야합니다. 루비를 이미 설치했다면 소스를 다시 컴파일하기 전에 파일을 제거해야합니다 !!!

# 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

libyaml 파일을 소스와 별도로 빌드하고 / usr / local / lib에 설치했습니다. RVM이 만든 루비는 여전히 그것들을 보지 못했고, makefile 또는 시스템 LD_LIBRARY_PATH를 사용하지 않고 / usr / local / lib / libyaml *를 ~ / .rvm / rubies / ruby-1.9.3-p327 /에 복사했습니다. lib /

그 경고를 조용히했다.


이것은 우분투에서 나를 위해 일한 것입니다 :
-libyaml-dev 설치 (sudo apt-get install libyaml-dev)
-rvm + ruby ​​1.9.3 설치


이 답변을 모두 시도했지만 여전히 작동하지 못했습니다. homebrew와 함께 libyaml을 설치 한 다음 rvm과 함께 Ruby 1.9.3 및 2.0.0을 설치했습니다. 매번 나는 정신병자 (libyaml)가 없다고 불평했다. 그러나 libyaml을 설치하려고하면 이미 설치되어 있다고 말했습니다. 헹구고 반복하십시오. 어.

마지막으로 libyaml 제거하는 것이 었습니다. 그런 다음 rvm에서 autolibs를 활성화했습니다 (적어도 OSX에서는). rvm이 종속성을보다 직접 설치하고 관리 할 수 ​​있습니다. 이제 Rubies를 설치할 때 rvm은 libyaml을 설치하고 그것이 올바른 위치에 있음을 인식 할 수있었습니다.

따라서 다른 모든 옵션을 시도한 경우 실제로 libyaml을 제거한 다음 Rubies를 설치하십시오. 오류 메시지에서 직관적으로 보이지만 마침내 저에게 효과적이었습니다.


나는 같은 문제가 있었지만 ( Cent OS 5.7 ) 위의 해결책 중 어느 것도 나에게 효과가 없었다.

// 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.

여러 번 다시 설치 한 후, 1.9.1대신 루비 버전에서 yaml을 찾고 있음을 깨달았습니다 1.9.3. 그래서 나는 다운 그레이드했다

// obviously after installing `libyaml`
rvm remove all
rvm install 1.9.1
rvm use 1.9.1 --default

그리고 그것은 8D로 일했습니다!


CentOS 6.3에서는 위의 어느 것도 작동하지 않았습니다. 그러나 루비 설치 하기 전에 소스에서 libyaml설치하면 문제가 해결되었습니다.

$ 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

그리고

rvm install 1.9.3
gem install rails

나는 사용하고있다

rvm 1.16.20 (버전) : Wayne E. Seguin, Michal Papis [https://rvm.io/]

번들 설치 중에 다음 오류가 발생했습니다.

.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

  1. export LD_LIBRARY_PATH=/usr/local/lib
  2. 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
    
  3. 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


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)

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


For those with Mountain Lion and RVM version >= 1.18.x

RVM ships with this new tool that is used as a flag when installing ruby versions. It's called autolibs.

I got rid of this psych problem by doing the following:

rvm reinstall ruby-1.9.3-p392 --autolibs=3

Read the help text BEFORE by doing:

rvm help autolibs

Cool.


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!

참고URL : https://stackoverflow.com/questions/9434002/how-to-solve-ruby-installation-is-missing-psych-error

반응형