2011-09-21 96 views
0

我在/Library/Ruby/Gems/1.8/gems/rspec-2.6.0/lib中找到rspec 我甚至在我的.bash_profile文件中放入了一個路徑: PATH =「 /usr/local/bin:/Library/Ruby/Gems/1.8/gems/rspec-2.6.0/lib:-bash:rspec:command not found

但是當我在終端中輸入rspec時,我找不到命令,即使當我在?同一目錄下的文件RSpec的

除了作爲一個菜鳥,我究竟做錯了

* 更新: *我可以使用「束EXEC rspec的」執行rspec的,但我想弄清楚爲什麼我不能只使用rspec。

回答

0

檢查您的PATH環境變量是否您期望的。 echo $PATH
檢查您的目標二進制文件是否具有可執行權限。 ls -l /Library/Ruby/Gems/1.8/gems/rspec-2.6.0/lib
再次檢查。 which rspec

0

的文件是可執行的二進制一般需要:

(a) make the file executable by running chmod 755 /path/to/scripts/awesometask.gem 
(b) add a "shebang" to the top of the file (first line) that contains the path of the interpreter for the script: #!/usr/bin/ruby 
(c) execute file with full path: /path/to/scripts/awesometask.gem 
or 
(c1) add the folder where the file is to PATH: PATH=$PATH:/path/to/scripts