2012-07-31 145 views
3

我安裝了rspec寶石。我得到了以下信息bash:spec:找不到命令

Successfully installed rspec-2.11.0 
1 gem installed 
Installing ri documentation for rspec-2.11.0... 
Installing RDoc documentation for rspec-2.11.0... 

但是當我運行

spec path/to/file.rb 

我得到

-bash: spec: command not found 

對此有何解決方案?

+0

'哪個規格'的輸出是什麼? – 2012-07-31 05:54:46

回答

10

我想你應該運行

rspec path/to/file.rb 
+5

確實。該命令現在是'rspec'而不是'spec'。近兩年來一直如此。 – 2012-07-31 05:57:50

1

首先嚐試使用rspec,而不是僅僅spec

其次,試試這個 出口PATH = $ PATH:/路徑/到/寶石/箱

明顯地用正確的替換了虛擬路徑,指向你的寶石安裝路徑中的bin目錄。例如,我的是~/.rvm/gems/ruby-1.9.3-p194/bin