rvm을 사용하여 루비 1.9.2-p0을 최신 패치 레벨로 업그레이드하려면 어떻게합니까?
현재 루비 버전은 ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0]
rvm을 사용하여 최신 패치 수준으로 업데이트하고 싶습니다. 어떻게해야합니까?
우선을 실행하여 RVM 설치를 업데이트하십시오 rvm get stable
.
새 RVM 버전을 실행하려면 실행해야합니다 rvm reload
(또는 새 터미널을 열어야 함).
완료되면 RVM에 설치하여 사용할 수있는 루비 버전을 나열하도록 요청할 수 있습니다 rvm list known
.
출력에서 다음을 볼 수 있습니다 :
# MRI Rubies
...
[ruby-]1.9.2[-p320]
...
패치 레벨 주위의 대괄호는 이것이 현재 루비 1.9.2에 대한 RVM의 기본 패치 레벨임을 나타냅니다.
마지막으로, 새로운 루비 버전을 설치하려면 그냥 실행 rvm install 1.9.2
하고 컴파일 될 때까지 기다리십시오!
루비 인터프리터를 업그레이드 하고 기존 gemsets을 계속 :
$ rvm upgrade 1.9.2-p0 1.9.2
Are you sure you wish to upgrade from ruby-1.9.2-p0 to ruby-1.9.2-p136? (Y/n): Y
1.9.2의 최신 안정 릴리스로 교체합니다. 이것은 혼란을 피합니다.
의견 덕분에 도움이되는 추가 팁 (@Mauro, @James, @ACB)
$ rvm list known
# NOTE: you probably want to upgrade your rvm first, as the list of known rubies seems to be coupled to the rvm version.
$ rvm get stable
$ rvm list known #pick your ruby
첫 번째 업데이트 RVM :
rvm get stable
그런 다음 Ruby 버전을 업데이트하십시오.
rvm upgrade 2.0.0
모든 질문에 대해 예를 선택하십시오.
Are you sure you wish to upgrade from ruby-2.0.0-p195 to ruby-2.0.0-p247? (Y/n): Y
Are you sure you wish to MOVE gems from ruby-2.0.0-p195 to ruby-2.0.0-p247?
This will overwrite existing gems in ruby-2.0.0-p247 and remove them from ruby-2.0.0-p195 (Y/n): Y
Do you wish to move over aliases? (Y/n): Y
Do you wish to move over wrappers? (Y/n): Y
Do you also wish to completely remove ruby-2.0.0-p195 (inc. archive)? (Y/n): Y
보석을 최신 버전으로 업데이트하려면 다음을 수행하십시오.
rvm all do gem update
편집 : 오늘 막 최신 버전의 ruby 2.0.0 (루비 -2.0.0-p195에서 루비 -2.0.0-p353으로 업데이트)에 대해이 작업을 수행했습니다. 그 후 보석을 업데이트하려고 할 때 세그먼테이션 오류가 발생했습니다. gem은 ruby-2.0.0-p195 용으로 설치되었고 일부는 p353과 호환되지 않기 때문에 발생합니다.
이제 호환되지 않는 보석을 찾아 볼 수 있지만 가장 쉬운 해결책은 설치된 모든 보석을 제거하고 다시 설치하는 것입니다. gems/ruby-2.0.0-p353
에있는 디렉토리를 간단히 제거 했습니다 /usr/local/rvm
. 다른 곳일 수도 있습니다.
그런 다음 내가 실행 gem install bundler
한 각 레일 앱마다 실행했습니다 bundle install
.
이처럼 :
rvm update; rvm reload
rvm install ruby-1.9.2-p136
rvm --default ruby-1.9.2-p136
위키 의 페이지를 따라 패치 레벨을 설치할 수 있습니다 .
또한 각 루비는 독립적이므로, 실제로 gem을 업그레이드하고 유지하는 것이 아니라 새로운 패치 버전을 설치 한 다음 새로운 루비 환경에 gem을 설치합니다.
이것은 보석 세트가 등장했을 수도 있지만 사용하지는 않습니다.
잠시 동안 만 rvm을 업데이트하는 것을 잊지 마십시오.
npad's answer definitely lays out the basics so I won't reiterate those steps, but there are several answers here suggesting using rvm upgrade
. I know that rvm gives you the option, but it's a bit of a dangerous one.
IMO, the safer and more "rvm way" is to first rvm install
the new ruby version, then use the rvm gemset copy
command to copy your gemset(s) to the new ruby version, e.g. rvm gemset copy 1.9.2-p0@some-gemset 1.9.2-p290@some-gemset
. Then you can easily switch your project to using the newly-copied gemset (I recommend using an .rvmrc
file in your project directory) and see if your code fails. If it does, changing back to the old ruby version is just a matter of switching the gemset.
But even if you don't use gemsets (though I assume you do since you tagged rails on this question), the use of rvm upgrade
can lead to unexpected failures. And if your code breaks, now you have to reinstall the old version again. Just take a bit more time and do it the clean way.
I guess its rvm install 1.9.2-head
You can see available rubies with rvm list known
This blog post should be helpful: http://pogodan.com/blog/2011/09/06/ruby-1-9-3-for-development
essentials:
rvm get head
rvm reload
wget https://gist.github.com/raw/1008945/4edd1e1dcc1f0db52d4816843a9d1e6b60661122/ruby-1.9.2p290.patch
rvm install ruby-1.9.2-p290 --patch ruby-1.9.2p290.patch -n patched
'development' 카테고리의 다른 글
SQL 쿼리를 사용하여 테이블 이름을 변경하는 방법은 무엇입니까? (0) | 2020.07.23 |
---|---|
Mac OS X 10.13 High Sierra에서 homebrew에 대해 / usr / local을 숨길 수 없음 (0) | 2020.07.23 |
치명적 경보 수신 : SSLHandshakeException을 통한 handshake_failure (0) | 2020.07.23 |
PHP에서 유형 저글링 및 (엄격한) 비교 (0) | 2020.07.23 |
파일이나 디렉토리가 있는지 확인하는 방법? (0) | 2020.07.23 |