4

私は Mac OS (10.8.4) を使用しているため、システム バージョンの ruby​​ がインストールされています (1.8.7)。システムに必要なため、削除できないことはわかっています。ただし、Octopress 経由で GitHub に Jekyll ブログを設定することに興味があります: http://octopress.org。Rubyバージョン1.9.3が必要なので、経由で追加しました

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'

私は rvm ではなく rbenv を使用しています (ただし、違いがあれば喜んで切り替えます)。今私は実行します:

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 に問題があるかどうかわかりません (echo $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 に適切に接続する方法を知っている人はいますか?

4

2 に答える 2

3

何らかの理由で

rbenv global 1.9.3-p448

octopress フォルダー内で Ruby のデフォルトを設定することはできませんでしたが、ローカルで実行したとき

rbenv local 1.9.3-p448

すべてが機能しました。

于 2013-08-24T05:01:34.550 に答える