2

在任何调用 rake 时都会收到以下错误。我正在研究在安装了 RVM 的 JRuby (1.5.1) 上运行的 Rails 3。我认为情况并非总是如此,但我不知道如何追踪它。我是否认为这与我安装的 gems (清单包括在下面)有关?

$ rake metrics:all
/Users/Eric/.rvm/gems/jruby-1.5.1@backend/bin/rake: line 9: require: command not found
/Users/Eric/.rvm/gems/jruby-1.5.1@backend/bin/rake: line 11: version: command not found
/Users/Eric/.rvm/gems/jruby-1.5.1@backend/bin/rake: line 13: syntax error near unexpected token `('
/Users/Eric/.rvm/gems/jruby-1.5.1@backend/bin/rake: line 13: `if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then'


*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta4)
actionpack (3.0.0.beta4)
activemodel (3.0.0.beta4)
activerecord (3.0.0.beta4)
activerecord-jdbc-adapter (0.9.7)
activeresource (3.0.0.beta4)
activesupport (3.0.0.beta4)
arel (0.4.0)
arrayfields (4.7.4)
autotest (4.3.2)
autotest-growl (0.2.4)
autotest-rails (4.1.0)
builder (2.1.2)
bundler (0.9.26)
capybara (0.3.9)
chronic (0.2.3)
churn (0.0.12)
configuration (1.1.0)
cucumber (0.8.3)
cucumber-rails (0.3.2)
culerity (0.2.10)
database_cleaner (0.5.2)
diff-lcs (1.1.2)
erubis (2.6.6)
factory_girl (1.3.1)
factory_girl_rails (1.0)
fattr (2.1.0)
ffi (0.6.3)
flay (1.4.0)
flog (2.2.0)
gherkin (2.0.2)
hirb (0.3.2)
hoe (2.6.1)
hoptoad_notifier (2.3.2)
i18n (0.4.1)
jdbc-mysql (5.0.4)
jruby-openssl (0.7)
json (1.4.3)
json-jruby (1.4.3.1)
json_pure (1.4.3)
launchy (0.3.5)
mail (2.2.5)
main (4.2.0)
mechanize (1.0.0)
mime-types (1.16)
nokogiri (1.4.2)
open_gem (1.4.2)
pickle (0.3.0)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.6)
rack-test (0.5.4)
rails (3.0.0.beta4)
railties (3.0.0.beta4)
rake (0.8.7)
rcov (0.9.8)
rdoc (2.5.9)
redis (2.0.3)
redis-namespace (0.7.0)
resque (1.9.7)
rspec (2.0.0.beta.16, 1.3.0)
rspec-core (2.0.0.beta.16)
rspec-expectations (2.0.0.beta.16)
rspec-mocks (2.0.0.beta.16)
rspec-rails (2.0.0.beta.16)
ruby_parser (2.0.4)
rubyforge (2.0.4)
rvm (0.1.41)
Saikuro (1.1.0)
selenium-webdriver (0.0.24)
sexp_processor (3.0.4)
shoulda (2.11.1)
sinatra (1.0)
spork (0.8.4)
term-ansicolor (1.0.5)
thor (0.13.7)
treetop (1.4.8)
trollop (1.16.2)
tzinfo (0.3.22)
vegas (0.1.7)
weakling (0.0.4)
webrat (0.7.1)
ZenTest (4.3.3)
4

1 回答 1

2

shell 将 bin/rake 脚本解释为 Bash 脚本,而不是 Ruby 脚本。您可以检查 bin/rake 顶部的 shebang 行和/或重新安装 rake。如果这无法解决问题,您可以jruby -S rake改为运行。

于 2010-07-11T18:56:59.580 回答