Created
February 9, 2012 20:44
-
-
Save gdinwiddie/1782945 to your computer and use it in GitHub Desktop.
ant target for running cucumber
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cuke4: | |
[java] Gem::LoadError: Could not find RubyGem cucumber (>= 0) | |
[java] | |
[java] report_activate_error at /Users/gdinwiddie/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems.rb:861 | |
[java] activate at /Users/gdinwiddie/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems.rb:255 | |
[java] gem at /Users/gdinwiddie/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems.rb:1215 | |
[java] (root) at /Users/gdinwiddie/jruby-1.6.2/bin/cucumber:18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<target name="cuke4" description="Run the cucumber tests"> | |
<java classname="org.jruby.Main" fork="true" failonerror="true"> | |
<classpath> | |
<fileset dir="${jruby.home}/lib"> | |
<include name="*.jar"/><!-- finds 'jruby' --> | |
<include name="**/*.rb" /><!-- doesn't help --> | |
</fileset> | |
<pathelement location="${jruby.home}/lib/ruby/site_ruby/1.8"/><!-- finds 'rubygems' --> | |
<pathelement location="${jruby.home}/lib/ruby/gems/**/lib"/><!-- doesn't help --> | |
<pathelement location="${jruby.home}/lib/ruby/gems/1.8/gems/cucumber-1.0.0/lib"/><!-- doesn't help --> | |
<pathelement location="${jruby.home}/lib/ruby/gems/1.8/gems"/><!-- doesn't help --> | |
<pathelement location="${jruby.home}/lib/ruby/gems/1.8"/><!-- doesn't help --> | |
<pathelement location="${jruby.home}/lib"/><!-- doesn't help --> | |
</classpath> | |
<arg value="-S"/> | |
<arg value="${jruby.home}/bin/cucumber"/> | |
</java> | |
</target> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gempath: | |
[java] NameError: uninitialized constant Gem | |
[java] const_missing at org/jruby/RubyModule.java:2569 | |
[java] (root) at -e:1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<target name="gempath" description="display the gem path"> | |
<java classname="org.jruby.Main" fork="true" failonerror="true"> | |
<classpath> | |
<fileset dir="${jruby.home}/lib"> | |
<include name="*.jar"/> | |
</fileset> | |
<pathelement location="${jruby.home}/lib/ruby/site_ruby/1.8"/><!-- finds 'rubygems' --> | |
</classpath> | |
<arg value="-e"/> | |
<arg value="puts Gem.path"/> | |
</java> | |
</target> | |
I went back to the simple and obvious start, and, once I found the key to reading the OS environment variables, got it working with the following:
<target name="cucumber" description="Run the cucumber tests">
<property environment="env" />
<exec executable="cucumber" >
<env key="PATH" path="${env.PATH}:${jruby.home}/bin" />
<env key="CLASSPATH" file="${jruby.home}/lib/jruby.jar" />
</exec>
</target>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: I started with the simple and obvious:
but that gives me "java.lang.ClassNotFoundException: org.jruby.Main"