Programing

RVM을 사용하여 Rails on Lion을 설치할 수없는 이유는 무엇입니까?

crosscheck 2020. 9. 22. 07:33
반응형

RVM을 사용하여 Rails on Lion을 설치할 수없는 이유는 무엇입니까?


RVM을 사용하여 OS X Lion에 Rails를 설치하는 데 문제가 있습니다.

지금까지 다음을 수행했습니다.

  1. Mac OS X Lion 버전 10.7 (빌드 11A459e)을 설치했습니다.
  2. XCode 4.1 Developer Preview 5를 설치했습니다.
  3. RVM을 설치했습니다.
  4. 명령을 사용하여 RVM을 통해 Ruby 1.8.7 버전을 설치했습니다 rvm install 1.8.7. 참고 : 1.9.2가 아닌 1.8.7을 사용해야합니다.
  5. 명령을 사용하여 Ruby 1.8.7 버전으로 전환했습니다 rvm 1.8.7.
  6. 명령을 사용하여 새 gemset을 만들었습니다 rvm gemset create rails3.
  7. 명령을 사용하여 새 gemset으로 전환했습니다 rvm use 1.8.7@rails3.
  8. Rails를 설치하기 위해 명령을 실행 gem install rails했지만 다음 오류가 발생했습니다.

    /Users/m/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:60 : [BUG] 분할 오류

gem 명령을 실행하려고 할 때 동일한 오류가 발생하므로 Rails에서 실제로 문제가 없다고 생각합니다.

아래 링크로 판단 할 때이 문제가있는 사람이 저 뿐인 것 같습니다.

http://twitter.com/#!/pingles/status/66261101351927809https://github.com/carlhuda/bundler/issues/1058


고쳤다!

답변은 실제로 위에 게시 한 링크 중 하나에 있습니다. 루비 버전 (rvm 설치 1.8.7)을 설치하기 전에 " export CC=/usr/bin/gcc-4.2" 를 실행해야했습니다 . 그 자리에서 모든 것이 순조롭게 실행되었습니다.

CC영구적으로 내 보내지 않으려면 다음을 수행 할 수 있습니다.CC=/usr/bin/gcc-4.2 rvm install 1.8.7

이미 루비 1.8.7을 설치 한 경우. 그냥 해CC=/usr/bin/gcc-4.2 rvm reinstall 1.8.7


Xcode 4.2를 설치했다면 실제로는 더 이상 비 LLVM gcc를 설치하지 않으므로 추가해야합니다. 어떤 이유로 4.2를 설치 한 후 4.1로 다운 그레이드하는 것이 올바르게 작동하지 않습니다 (적어도 저에게는 그렇지 않았고 다른 사람들도 비슷한 문제를 겪었습니다).

꽤 많은 시간을 보낸 후 마침내 이것이 저에게 효과적이었습니다.

  1. App Store에서 Xcode 4.2 설치
  2. OSX gcc 설치 프로그램을 사용하여 darwin gcc 설치
  3. REE를 설치하여 이전 시도의 흔적을 모두 제거하십시오.

열려있는 모든 터미널 창을 닫고 새 창을 연 다음

rvm remove ree
export CC=/usr/bin/gcc-4.2
rvm install ree

이것은 rvm 1.8.6, OS X 10.7.2 및 gcc-4.2 버전 4.2.1 (Apple 빌드 5666)에서 저에게 효과적이었습니다.

이미 Xcode 4.1을 설치 한 경우 4.2로 업그레이드하려는 충동에 저항하고 괜찮을 것입니다.


그래도 작동하지 않으면 --force를 추가하십시오. 따라서 이것은 다음과 같습니다.

CC=/usr/bin/gcc-4.2 rvm install ruby-1.8.7 --force


당신이 이미 "사용하기 전에 설치 한 경우는 1.8.7을 제거하는 것이 확인 export CC=/usr/bin/gcc-4.2"을 수행하여 " rvm remove 1.8.7"


내 시스템에서 동일한 문제가 발생했습니다. LLVM 컴파일러와 함께 제공되고 LLVM 무료 컴파일러없이 제공되는 Apple Xcode 명령 줄 도구를 설치했습니다 .

Ruby 1.8.7은를 사용하지 않아도 LLVM 컴파일러에서 작동하지 않으므로 CC=clangLLVM 무료 gcc를 설치하면 문제가 해결됩니다.

여기에 여러 옵션이 나열됩니다.

https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers

간단히 말해서 Homebrew 와 함께 GCC v4.2를 설치하십시오 .

brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb

그리고 다음 1.8.7 루비 설치 :

CC=gcc-4.2 rvm install 1.8.7

" export CC=/usr/bin/gcc-4.2" 대신 " export CC=gcc"(xCode 4.2.x를 설치해야합니다).


다음과 같은 gcc 버전을 확인하십시오.

ls -Al `which gcc-4.2`

I followed the instructions here: http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion

brew update
brew tap homebrew/dupes
brew install apple-gcc42

Then reinstall:

Check again what your path to gcc is (to use for CC=):

ls -Al `which gcc-4.2`

(optional) You can set this in your .bashrc for example:

export CC=/usr/bin/gcc-4.2

(optional) remove any old version of ruby

rvm remove 1.8.7

Then:

CC=/usr/local/bin/gcc-4.2 rvm --verify-downloads 1 reinstall 1.8.7-p357 --without-tcl --without-tk 

or if you have set CC in your profile

rvm --verify-downloads 1 reinstall 1.8.7-p357 --without-tcl --without-tk 

Note the flags on the rvm install. I had trouble verifying the checksum on the ftp server and some problems with tck and what not. You may be able to omit those flags.

Also: you might need to remove an old version of your gemset:

rvm gemset delete <gemset>

Then

gem install bundler
bundle install

Hope this helps.


Using macport and ruby-1.9.x version. I did successfully install rails with ruby gem.


I have same problem only for arch x86_64, when I comment line in my ~/.rvmrc

rvm_archflags="-arch x86_64"

Open a new terminal and tried to install ruby-1.8.7 again

rvm install 1.8.7

It was successful.


If you're using RVM in a development workflow, I added a fix in an .rvmrc file for OS X Lion.

https://gist.github.com/1112962

(updated file name)


This is not related to RVM, but if what you are looking for is a local development environment for Lion you may want to give a try to RubyStack It is a free, open source all-in-one installer for Apache, MySQL, Ruby, Rails, etc. It does not require compilation and it is self-contained so if you do not like it you can simply remove the installation directory and you are done. Disclaimer: I'm one of the RubyStack developers :)


CC=/usr/bin/gcc-4.2 rvm install 1.8.7 did not work for me, I used CC=/usr/bin/gcc rvm install 1.8.7 and it did (checking with "which gcc")


Even with all the other suggestions on this page I was still getting segfaults and getting frustrated, so I said "screw it!" and use the system-provided Ruby 1.8.7:

rvm use system

You need to use sudo for installing gems, but still waay less headache.


My solution was to override the /usr/bin/gcc symlink in the terminal. Here's how I did it:

https://plus.google.com/101970693023462019144/posts/eYVLvMCqTmc

This not only fixed my RVM installation, but also made sure that installing gems with native extensions (like rmagick) work.

참고URL : https://stackoverflow.com/questions/6170813/why-cant-i-install-rails-on-lion-using-rvm

반응형