2011-05-15 62 views
3

我對RoR完全陌生。我正在關注邁克爾哈特爾的書。我無法進行自動測試運行。請提出發生了什麼問題並提供解決方案。未找到命令/使用自動測試安裝缺少的gem二進制文件與'軟件包安裝'

當我運行在內部Rails項目目錄命令行「自動測試」我得到以下幾點:

-bash: autotest: command not found 

當我運行「捆綁EXEC自動測試」我得到如下:

bundler: command not found: autotest 
Install missing gem binaries with `bundle install' 

這裏是的Gemfile

source 'http://rubygems.org' 

gem 'rails', '3.0.3' 
gem 'sqlite3-ruby', :require => 'sqlite3' 

group :development do 
gem 'autotest' 
gem 'rspec-rails', '2.4.1' 
end 

group :test do 
gem 'rspec', '2.4.0' 
gem 'webrat', '0.7.1' 
end 

這裏是 '寶石列表'

輸出
abstract (1.0.0) 
actionmailer (3.0.7, 3.0.6, 3.0.3, 2.3.5, 1.3.6) 
actionpack (3.0.7, 3.0.6, 3.0.3, 2.3.5, 1.13.6) 
actionwebservice (1.2.6) 
activeresource (3.0.7, 3.0.6, 3.0.3, 2.3.5) 
activesupport (3.0.7, 3.0.6, 3.0.3, 2.3.5, 1.4.4) 
acts_as_ferret (0.4.3) 
arel (2.0.9) 
autotest (4.4.6) 
autotest-fsevent (0.2.5) 
autotest-growl (0.2.9) 
autotest-notification (2.3.1) 
autotest-rails-pure (4.1.2) 
builder (2.1.2) 
bundler (1.0.12) 
capistrano (2.5.2) 
cgi_multipart_eof_fix (2.5.0) 
configuration (1.2.0) 
daemons (1.0.10) 
diff-lcs (1.1.2) 
dnssd (0.6.0) 
erubis (2.6.6) 
fastthread (1.0.1) 
fcgi (0.8.7) 
ferret (0.11.6) 
gem_plugin (0.2.3) 
heroku (2.0.4) 
highline (1.5.0) 
hpricot (0.6.164) 
i18n (0.5.0) 
launchy (0.4.0) 
libxml-ruby (1.1.2) 
mail (2.2.19, 2.2.15) 
mime-types (1.16) 
mongrel (1.1.5) 
mysql2 (0.2.7) 
needle (1.3.0) 
net-scp (1.0.1) 
net-sftp (2.0.1, 1.1.1) 
net-ssh (2.0.4, 1.1.4) 
net-ssh-gateway (1.0.0) 
nokogiri (1.4.4) 
notifier (0.1.3) 
polyglot (0.3.1) 
rack (1.2.2, 1.0.1) 
rack-mount (0.6.14) 
rack-test (0.5.7) 
rails (3.0.7, 3.0.6, 3.0.3, 2.3.5, 1.2.6) 
railties (3.0.7, 3.0.6, 3.0.3) 
rake (0.8.7, 0.8.3) 
RedCloth (4.1.1) 
redgreen (1.2.2) 
rest-client (1.6.1) 
rspec (2.5.0, 2.4.0) 
rspec-core (2.5.1, 2.4.0) 
rspec-expectations (2.5.0, 2.4.0) 
rspec-mocks (2.5.0, 2.4.0) 
rspec-rails (2.5.0, 2.4.1) 
ruby-openid (2.1.2) 
ruby-yadis (0.3.4) 
rubygems-update (1.7.2) 
rubynode (0.1.5) 
spork (0.8.4) 
sqlite3-ruby (1.3.2, 1.2.5, 1.2.4) 
sys-uname (0.8.5) 
term-ansicolor (1.0.5) 
termios (0.9.4) 
test_notifier (0.3.6) 
thor (0.14.6) 
treetop (1.4.9) 
tzinfo (0.3.27, 0.3.26) 
webrat (0.7.1) 
xmpp4r (0.4) 
ZenTest (4.5.0) 
+1

那麼,你是否嘗試運行'bundle install'? – 2011-05-15 16:43:52

+0

是的..'捆綁安裝'工作正常,但自動測試不起作用。 – aspire 2011-05-16 05:23:43

+0

這可能不是你的問題,但我在很多場合看到,在Windows上使用Bundler時,二進制文件沒有正確安裝。我不得不手動卸載gem並手動安裝。環境:Windows 7,jruby 1.6.2,Bundler,Rails3 + – 2012-02-23 19:49:17

回答

7

bundle install --binstubs都會從你的包中的可執行文件安裝到項目的本地bin目錄(見http://gembundler.com/),那麼你可以運行./bin/autotest

+1

我試過了。 – aspire 2011-05-16 05:30:22

+0

您可能會嘗試從全局gemset中刪除ZenTest/autotest,而是將其安裝到基於rvm的gemset中,看看是否有幫助。 – karmajunkie 2011-05-16 13:18:16

+0

我迷失在這裏。你能給我指導如何做基於rvm的gemset安裝嗎? thx – aspire 2011-05-17 05:27:53

5

只需重新啓動終端選項卡,然後重試。這應該解決它。

+1

這工作!爲我節省了很多時間。泰 – 2014-10-30 11:53:17

0

確保您將自動測試命令放入測試塊中。你似乎只有在開發區塊。然後,做捆綁安裝

0

RVM的用戶:

$ rvm gemset create myapp 
$ bundle install 

爲我工作。

2

我有一個類似的錯誤

bundler: command not found: thin 
Install missing gem executables with `bundle install` 

運行以下命令來添加所需的寶石:

bundle install --deployment

-1

我有同樣的問題,但我按照這些步驟和下載MySQL的。這個鏈接會告訴你如何去做。 mysql 現在我有重置密碼的問題,但一旦你打開第二個下載文件,你將不得不把臨時密碼,然後它會要求你更改密碼。

相關問題