Jenkins + Ruby与RVM。意外的tCONSTANT错误

时间:2014-09-10 11:54:25

标签: ruby cordova jenkins rvm

我们正在下载最新的Cordova文档,并希望使用Jenkins生成它。

我们正在使用RVM来管理Ruby实例。

以下是Jenkins作业中的相关shell执行。

#!/bin/bash
source "$HOME/.rvm/scripts/rvm"

echo "====== Setting up ruby ========================================"
rvm use "1.7.8"
set -e

echo "====== Installing cordova docs dependencies ==================="
gem install bundler
gem install nokogiri

cd "${WORKSPACE}/submodule_apache_cordova_docs"
bundle install
cd -

echo "====== Generating documents ==================================="
rvm current
ruby -v
${WORKSPACE}/submodule_apache_cordova_docs/bin/generate

这是该部分的输出

[workspace] $ /bin/bash /tmp/hudson1421417307959072745.sh
====== Setting up ruby =====================================
Using /var/lib/jenkins/.rvm/gems/jruby-1.7.8
====== Installing cordova docs dependencies ================
Successfully installed bundler-1.7.2
1 gem installed
Successfully installed nokogiri-1.6.3.1-java
1 gem installed
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using json 1.8.1
Using nokogiri 1.5.9
Using rspec 1.3.0
Using bundler 1.7.2
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
/var/lib/jenkins/jobs/Build-Documentation/workspace
====== Generating documents ================================
jruby-1.7.8
jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on OpenJDK 64-Bit Server VM 1.7.0_65-b32 [linux-amd64]
SyntaxError: /var/lib/jenkins/jobs/Build-Documentation/workspace/submodule_apache_cordova_docs/bin/../lib/cordova/jodoc.rb:28: syntax error, unexpected tCONSTANT
    @template_directories = [ File.join TEMPLATE_PATH, 'default' ]
                                                    ^
  require at org/jruby/RubyKernel.java:1084
  require at /var/lib/jenkins/.rvm/rubies/jruby-1.7.8/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
  require at /var/lib/jenkins/.rvm/rubies/jruby-1.7.8/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53
   (root) at /var/lib/jenkins/jobs/Build-Documentation/workspace/submodule_apache_cordova_docs/bin/../lib/docs_generator.rb:1
  require at org/jruby/RubyKernel.java:1084
   (root) at /var/lib/jenkins/jobs/Build-Documentation/workspace/submodule_apache_cordova_docs/bin/../lib/docs_generator.rb:26
   (root) at /var/lib/jenkins/jobs/Build-Documentation/workspace/submodule_apache_cordova_docs/bin/generate:22
Build step 'Execute shell' marked build as failure
Finished: FAILURE

据我所知,所有依赖版本都是正确的,包括Ruby。

这是错误的文件:https://github.com/apache/cordova-docs/blob/master/lib/cordova/jodoc.rb

导致错误的原因是什么?

由于

0 个答案:

没有答案