태그 보관물: ruby

ruby

Ruby 1.8.7을 제거하고 Ruby 1.9.2를 어떻게 설치합니까? 누구든지 Ruby

누구든지 Ruby 1.8.7을 올바르게 제거하고 Ubuntu 11.10에 Ruby 1.9.2를 설치하는 방법을 알고 있습니까?

나는 철저히 검색했으며 찾은 자습서 중 아무것도 작동하지 않았습니다.

또한 RVM을 작동시키는 데 오랜 시간이 걸렸으며 사용하기가 쉽지 않습니다. 또한 이전 버전에는 거의 쓸모가 없습니다.

출력 업데이트 :

which ruby:

/usr/local/bin/ruby

ls -l /usr/local/bin/ruby:

lrwxrwxrwx 1 root root 16 2011-10-17 21:20 /usr/local/bin/ruby -> /usr/bin/ruby1.8

ls -l /etc/alternatives/ruby:

lrwxrwxrwx 1 root root 18 2011-12-30 17:35 /etc/alternatives/ruby -> /usr/bin/ruby1.9.1

echo $PATH:

/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

그런데 –config gem을 보면 보석이 하나만 있다는 것을 알 수 있습니다. /usr/bin/gem1.9.1



답변

둘 다 설치하는 데 문제가 있습니까? 그리고 저장소의 버전을 사용합니까? 루비 1.9.2를 다음과 같이 설치합니다.

sudo apt-get install ruby1.9.1-full

그런 다음 “alternatives”시스템을 업데이트하여 ruby ​​1.9를 사용하십시오 :

$ sudo update-alternatives --config ruby
There are 2 choices for the alternative ruby (providing /usr/bin/ruby).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/ruby1.8     50        auto mode
  1            /usr/bin/ruby1.8     50        manual mode
  2            /usr/bin/ruby1.9.1   10        manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in manual mode.
$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

이것은 또한 대한 대안을 설정합니다 erb, irb, rdoc, ri, testrb및 매뉴얼 페이지를. 그러나 gem 명령을 별도로 업데이트해야합니다.

$ sudo update-alternatives --config gem
There are 2 choices for the alternative gem (providing /usr/bin/gem).

  Selection    Path               Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gem1.8     180       auto mode
  1            /usr/bin/gem1.8     180       manual mode
  2            /usr/bin/gem1.9.1   10        manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/gem1.9.1 to provide /usr/bin/gem (gem) in manual mode.

나는 그것이 업스트림 데비안 패키징 일인 1.9.2가 아니라 ruby1.9.1이라고 혼동된다는 것을 안다.


답변

루비 1.8을 유지할 이유가 없다면 다음과 같이 제거하는 것이 더 쉽다는 것을 알았습니다.

sudo apt-get remove ruby1.8

sudo apt-get install ruby1.9.3


답변