我在Snow Leopard上安装了ruby,rubygems和rails the hivelogic way。当我改为我的新jekyll项目(〜/ Documents / blog / jekyll),然后运行
[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
我的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"
答案 0 :(得分:2)
你的$PATH
一团糟。您显示的bash_profile
我认为是~/.bash_profile
,但您没有显示/etc/profile
或~/.bashrc
或/etc/bash.bashrc
。当你启动一个非登录交互式shell时,最后两个是在你使用Terminal.app时获得的。 “profile”源代码来源于登录shell。如果他们以这种方式设置,可能会有另一个人来源。
如果您因为上面列出的一个或多个文件相互采购而导致PATH="something:$PATH"
被重复执行,那可能会导致您的混乱。
但是,“错误的翻译”消息的问题可能与您的$PATH
无关。该消息意味着脚本文件中的shebang(在我认为#!/some/path/to/ruby
中)与实际安装Ruby的地方不同。这就是为什么你经常会看到#!/usr/bin/env python
看起来像env
的shebang,所以$PATH
将通过{{1}}找出Python(在这种情况下)所在的位置。
答案 1 :(得分:1)
把
export PATH=/~/.gem:$PATH
在我的〜/ .bash_profile中做了伎俩