JRuby:Rake 因 Gem::Version 错误而失败

发布于 2024-09-08 15:09:59 字数 2174 浏览 6 评论 0原文

在任何对 rake 的调用中,我都会收到以下错误。我正在开发在安装了 RVM 的 JRuby (1.5.1) 上运行的 Rails 3。我不认为情况总是如此,但我不知道如何追踪它。我是否正确地认为这与我安装的宝石有关(下面列出了列表)?

$ 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)

I get the following error on any call to rake. I am working on a Rails 3 running on JRuby (1.5.1) installed with RVM. I don't think this was always the case, but I'm not sure how to track it down. Am I correct in think this has something to do with the gems I have installed (listing included below)?

$ 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

趁微风不噪 2024-09-15 15:10:00

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

The shell is interpreting the bin/rake script as a Bash script, not a Ruby script. You might check the shebang line at the top of bin/rake and/or reinstall rake. If that fails to fix the issue, you can run like jruby -S rake instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文