2009-11-15 56 views
1

我在雪豹和安裝紅寶石,rubygems和鐵軌the hivelogic way。當我改變我的新化身項目(〜/文檔/博客/化身),並運行

[jekyll]$jekyll --server-bash 

我得到:

[jekyll]$jekyll --server-bash: /usr/bin/jekyll: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory 

的利息,可以是:

[jekyll]$which ruby 
/usr/local/bin/ruby 

而且我推測問題是:

[jekyll]$echo $PATH 
/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:~/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:~/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:~/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:~/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:~/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:~/.gem:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin/:/Users/Joe/.gem:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin/:/Users/Joe/.gem:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin/:/usr/local/bin/gem:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/.gem/ruby/1.8/bin:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools:/Users/Joe/.gem/ruby/1.8/bin:/Users/Joe/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools 

re levant部分我的bash_profile:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH        
export MANPATH=/opt/local/share/man:$MANPATH 
export PATH=${PATH}:~/Documents/sdks/android-sdk-mac_x86-1.6_r1/tools 
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" 

回答

1

export PATH=/~/.gem:$PATH  

在我的〜/ .bash_profile中沒有的伎倆

2

你的$PATH是一團糟。您顯示bash_profile,我認爲這是~/.bash_profile,但您不顯示/etc/profile~/.bashrc/etc/bash.bashrc。當您使用Terminal.app啓動非登錄交互式shell時,會得到最後兩個。 「個人資料」的來源是登錄shell。如果他們這樣設置的話,可以找到其他人。

如果您有PATH="something:$PATH"重複執行,因爲您有一個或多個上面列出的文件相互採購,這可能會導致混亂。

但是,「糟糕的解釋器」消息的問題可能與您的$PATH沒有任何關係。該消息意味着腳本文件中的shebang(我認爲你的情況爲#!/some/path/to/ruby)與實際安裝Ruby的地方不同。這就是爲什麼你會經常看到shebangs看起來像#!/usr/bin/env python,所以env將通過$PATH找出Python(在這種情況下)所在的位置。

+0

是的,我的意思〜/ .bash_profile中。對其他文件配置文件沒有任何興趣,但是感謝路徑上的信息,並指出ruby的路徑在某個時刻已經出來。 – 2009-11-16 11:33:39