tsm*_*tsm 14 terminal jekyll osx-mountain-lion
我安装了jekyll,但令人惊讶的是osx不知道它的安装.
$ sudo gem install jekyll
Password:
Successfully installed jekyll-1.2.1
Parsing documentation for jekyll-1.2.1
Done installing documentation for jekyll after 1 seconds
1 gem installed
$ jekyll
-bash: jekyll: command not found
gem environment ( - INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0 )
$ cd /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0/gems/
Run Code Online (Sandbox Code Playgroud)
echo $PATH
/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/local/sbin:~/bin:/Users/TheSpiritMolecule/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/TheSpiritMolecule/.rvm/bin
Run Code Online (Sandbox Code Playgroud)
pba*_*tey 17
我安装了rbenv,我错过的步骤是做一个rbenv rehash
后gem install jekyll
.rehash在〜/ .rbenv/shims中创建一个链接,该链接包含在$ PATH中.
好吧,我必须检查$ PATH的含义是什么,以及它是什么.
问题很简单,不知怎的,我的ruby installion目录不在我的$ path变量中.
好的,这就是我解决它的方法:
echo "$PATH"
gem uninstall jekyll
find / -name jekyll (to delete if there is any leftovers somewhere )
gem environment ( get EXECUTABLE DIRECTORY path )
nano $HOME/.bash_profile ( go to the end of document and insert a new line )
export PATH="/usr/local/Cellar/ruby/2.0.0-p247/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)
你可以在临时的方式做到这一点,只需在终端写它而不是保存在你的终端 .bash_profile