태그 보관물: Octopress

Mac OS X Lion 10.7.3 에서 ruby 1.9.3 설치 삽질기

OS 환경은 Mac OS X Lion 10.7.3
참고로 xcode 4.3 버전이 설치되어 있다. ( 커맨드라인툴까지 설치한 상태 )

Github 에서 블로그를 할 수 있게 해주는 옥토프레스 (Octopress) 를 설치해 볼 요령으로, 루비를 설치하려는데 잘 안되고 에러가 나서, 실패경험을 포스팅 해둔다.

처음 발생했던 에러 :

rvm requires autoreconf to install the selected ruby interpreter however autoreconf was not found in the PATH

autoreconf 를 못찾겠다는건데, 알고보니 애플에서는 더이상 제공을 하지 않는 듯 하다. 나랑 비슷한 에러가 발생한 블로그 글(http://brianpeddle.com/2012/03/10/setting-up-ruby-on-rails-issues/)을 통해 정보를 얻었다.

간단하게 OS X 10.7 용 gcc installer 를 설치하면 된다.
https://github.com/kennethreitz/osx-gcc-installer/downloads

근데 문제는 여기서 끝나지 않았다.

두번째 에러 발생 :

Error running ‘patch -F 25 -p1 -N -f <“/Users/rkjun/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff”‘, please read /Users/rkjun/.rvm/log/ruby-1.9.3-p125/patch.apply.xcode-debugopt-fix-r34840.log
ruby-1.9.3-p125 – #autoreconf
ruby-1.9.3-p125 – #configuring
ruby-1.9.3-p125 – #compiling
Error running ‘make ‘, please read /Users/rkjun/.rvm/log/ruby-1.9.3-p125/make.log

사실 이 문제도, OS X 10.7용 gcc-installer 를 다운로드(링크는 요기)해서 설치하고 나면 해결이 되는 문제였는데, 아마도 설치후 재부팅을 하지 않아 오류가 발생했던 것 같다. -_-; 오늘 집에 와서,
rvm install 1.9.3 명령을 실행하니 잘 설치된다. 혹시 루비1.9.3 설치가 안되는 경우에는, non-llvm gcc 를 사용하기 위한, –with-gcc=clang 을 주고 설치해야 한다고 한다.

일단 이것으로 루비 설치는 완료했다.

.profile 에는 다음 코드를 추가해 놓자. (rkjun 은 user name 이다)

“/Users/rkjun/.rvm/scripts/rvm” ]] && source “/Users/rkjun/.rvm/scripts/rvm”
rvm use 1.9.3 –default

명시적으로 1.9.3 을 사용하겠다고 하지 않는 한, 여전히 맥에 기본내장된 1.8 버전대가 사용된다. -_-; 터미널을 재실행하고, 버전 확인.

~ rkjun$ ruby –version

ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]

이로써, 루비설치는 완료했고, 이제 옥토프레스(Octopress) 를 설치할 차례.

우선, bundler 설치는 잘 된다.

~ rkjun$ gem install bundler 

그 담에 다시 또 문제에 봉착.

~ rkjun$ bundle install

번들 설치중에 에러가 발생했다. -_-;

Installing rb-fsevent (0.4.3.1) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/Users/rkjun/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions’: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/Users/rkjun/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
creating Makefile
CFLAGS=’-isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -Os -pipe -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wsign-compare -Wnewline-eof -Wconversion -Wshorten-64-to-32 -Wglobal-constructors -pedantic’ /usr/bin/clang -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -dead_strip -framework CoreServices -o ‘/Users/rkjun/.rvm/gems/ruby-1.9.3-p125/gems/rb-fsevent-0.4.3.1/bin/fsevent_watch’ fsevent/fsevent_watch.c
fsevent/fsevent_watch.c:1:10: fatal error: ‘stdio.h’ file not found
#include <stdio.h>
^
1 error generated.
extconf.rb:59:in `<main>’: Compilation of fsevent_watch failed (see README) (RuntimeError)

덜덜덜.  stdio.h 파일이 없다니 -_-;
암튼, 이것도 간신히 해결했다.

방법은 간단했다.

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/

요거 한방이면 된다. (출처는 요기-Octopress issue 320)

10분만에 설치될 줄 알았던 걸, 이틀 삽질끝에 간신히 설치했다. -_-;

p.s  옥토프레스(octopress) 를 사용하기 위해선, ruby 1.9.2 를 설치해야 한다. (설치방법은 1.9.3 버전과 동일하므로 생략^^)

태그 지정됨 , , ,