我在Mac OS(10.8.4)上,所以安裝了ruby的系統版本(1.8.7)。我知道我無法刪除它,因爲它是我的系統所必需的。不過,我有興趣通過Octopress在GitHub上設置Jekyll博客:http://octopress.org。它需要Ruby 1.9.3版本,所以我通過如何在Mac OS X上將PATH指向新版本的ruby以連接Octopress
rbenv install 1.9.3-p385
這似乎已經奏效添加它(在幾個小時後意識到我不得不卸載,並通過MacPorts的舊版本的酒之前)。然而,當我運行
localhost:~ Dan$ ruby -v
我得到
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.4.0]
經常拿
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
但後來我跑
git clone git://github.com/imathis/octopress.git octopress
localhost:~ Dan$ cd octopress
,並得到
ruby-1.9.3-p448 is not installed.
To install do: 'rvm install ruby-1.9.3-p448'
我使用rbenv而不是rvm(但願意切換,如果它有所作爲)。現在我運行:
localhost:octopress Dan$ env CC=gcc rbenv install 1.9.3-p448
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/Dan/.rbenv/versions/1.9.3-p448
Downloading ruby-1.9.3-p448.tar.gz...
-> ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p448.tar.gz
Installing ruby-1.9.3-p448...
Installed ruby-1.9.3-p448 to /Users/Dan/.rbenv/versions/1.9.3-p448
然後
localhost:octopress Dan$ ruby --version
rbenv: version `1.9.3' is not installed
運行
which ruby
/Users/Dan/.rbenv/shims/ruby
我不知道是否有什麼毛病我的PATH(回聲$ PATH)
/Users/Dan/Library/Enthought/Canopy_64bit/User/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Users/Dan/.rbenv/shims:/Users/Dan/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin:/Users/Dan/scripts:/usr/local/mysql/bin:/Users/Dan/.rvm/bin
任何人都有一個想法,我如何可以得到Octopress窩國王和正確連接到適當的Ruby版本?
謝謝,我認爲這肯定會對未來超越這個問題有所幫助。 – djhocking