Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JRuby issue during install #199

Closed
jbpros opened this issue Feb 7, 2012 · 9 comments
Closed

JRuby issue during install #199

jbpros opened this issue Feb 7, 2012 · 9 comments
Assignees

Comments

@jbpros
Copy link
Member

jbpros commented Feb 7, 2012

I ran into the following error when I ran mvn clean install. Doing rvm use 1.8.7 fixed it.

I'm filing this issue even if it's fixed as @dkowis asked for it.

Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/1.8.5/groovy-all-1.8.5.jar (5996 KB at 585.4 KB/sec)
[INFO] Executing tasks

main:
     [copy] Copying 1 file to /Users/jbpros/Projects/cucumber-jvm/jruby/lib
     [echo] Building Gem
     [java] SyntaxError: /Users/jbpros/.rvm/bin/gem:3: syntax error, unexpected tSTRING_BEG
     [java] 
     [java] if [[ -s "/Users/jbpros/.rvm/environments/ruby-1.8.7-p334" ]]
     [java]          ^
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Cucumber-JVM ...................................... SUCCESS [26.706s]
[INFO] Cucumber-JVM: Core ................................ SUCCESS [1:53.823s]
[INFO] Cucumber-JVM: JUnit ............................... SUCCESS [1.025s]
[INFO] Cucumber-JVM: JRuby ............................... FAILURE [1:13.870s]
[INFO] Cucumber-JVM: Jython .............................. SKIPPED
[INFO] Cucumber-JVM: Java ................................ SKIPPED
[INFO] Cucumber-JVM: PicoContainer ....................... SKIPPED
[INFO] Cucumber-JVM: Spring .............................. SKIPPED
[INFO] Cucumber-JVM: Guice ............................... SKIPPED
[INFO] Cucumber-JVM: Weld/CDI ............................ SKIPPED
[INFO] Cucumber-JVM: Groovy .............................. SKIPPED
[INFO] Cucumber-JVM: Ioke ................................ SKIPPED
[INFO] Cucumber-JVM: Rhino ............................... SKIPPED
[INFO] Cucumber-JVM: Clojure ............................. SKIPPED
[INFO] Cucumber-JVM: OpenEJB ............................. SKIPPED
[INFO] Cucumber-JVM: Scala ............................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:48.315s
[INFO] Finished at: Tue Feb 07 23:06:20 CET 2012
[INFO] Final Memory: 18M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (package-gem) on project cucumber-jruby: An Ant BuildException has occured: Java returned: 1
[ERROR] around Ant part ...<java fork="true" jar="${maven.dependency.org.jruby.jruby-complete.jar.path}" failonerror="true">... @ 6:100 in /Users/jbpros/Projects/cucumber-jvm/jruby/target/antrun/build-main.xml
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cucumber-jruby
@ghost ghost assigned dkowis Feb 7, 2012
@aslakhellesoy
Copy link
Contributor

I don't understand why RVM kicks is in here - it shouldn't be involved at all. If you run Maven with -X it might print more useful information.

@undees
Copy link
Contributor

undees commented Feb 19, 2012

I get an error at the JRuby step, too--albeit with rbenv instead of RVM installed:

[INFO] Executing tasks
Build sequence for target(s) `main' is [main]
Complete build sequence is [main, ]

main:
     [copy] Copying 1 file to /Users/undees/src/ext/cujvm/jruby/lib
     [copy] Copying /Users/undees/src/ext/cujvm/jruby/target/cucumber-jruby-1.0.0.RC16-SNAPSHOT-full.jar to /Users/undees/src/ext/cujvm/jruby/lib/cucumber-jruby-full.jar
     [echo] Building Gem
     [java] Executing '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java' with arguments:
     [java] '-Dcucumber-jvm.version=1.0.0.RC16-SNAPSHOT'
     [java] '-jar'
     [java] '/Users/undees/.m2/repository/org/jruby/jruby-complete/1.6.6/jruby-complete-1.6.6.jar'
     [java] '-S'
     [java] 'gem'
     [java] 'build'
     [java] 'cucumber-jvm.gemspec'
     [java] 
     [java] The ' characters around the executable and arguments are
     [java] not part of the command.
Execute:Java13CommandLauncher: Executing '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java' with arguments:
'-Dcucumber-jvm.version=1.0.0.RC16-SNAPSHOT'
'-jar'
'/Users/undees/.m2/repository/org/jruby/jruby-complete/1.6.6/jruby-complete-1.6.6.jar'
'-S'
'gem'
'build'
'cucumber-jvm.gemspec'

The ' characters around the executable and arguments are
not part of the command.
     [java] NameError: undefined local variable or method `e' for main:Object
     [java]   (root) at /Users/undees/.rbenv/shims/gem:2
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Cucumber-JVM ...................................... SUCCESS [2.321s]
[INFO] Cucumber-JVM: Core ................................ SUCCESS [23.820s]
[INFO] Cucumber-JVM: JUnit ............................... SUCCESS [3.712s]
[INFO] Cucumber-JVM: JRuby ............................... FAILURE [15.077s]
[INFO] Cucumber-JVM: Jython .............................. SKIPPED
[INFO] Cucumber-JVM: Java ................................ SKIPPED
[INFO] Cucumber-JVM: PicoContainer ....................... SKIPPED
[INFO] Cucumber-JVM: Spring .............................. SKIPPED
[INFO] Cucumber-JVM: Guice ............................... SKIPPED
[INFO] Cucumber-JVM: Weld/CDI ............................ SKIPPED
[INFO] Cucumber-JVM: Groovy .............................. SKIPPED
[INFO] Cucumber-JVM: Ioke ................................ SKIPPED
[INFO] Cucumber-JVM: Rhino ............................... SKIPPED
[INFO] Cucumber-JVM: Clojure ............................. SKIPPED
[INFO] Cucumber-JVM: OpenEJB ............................. SKIPPED
[INFO] Cucumber-JVM: Scala ............................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.328s
[INFO] Finished at: Sun Feb 19 15:50:06 PST 2012
[INFO] Final Memory: 17M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (package-gem) on project cucumber-jruby: An Ant BuildException has occured: Java returned: 1
[ERROR] around Ant part ...<java fork="true" jar="${maven.dependency.org.jruby.jruby-complete.jar.path}" failonerror="true">... @ 6:100 in /Users/undees/src/ext/cujvm/jruby/target/antrun/build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (package-gem) on project cucumber-jruby: An Ant BuildException has occured: Java returned: 1
around Ant part ...<java fork="true" jar="${maven.dependency.org.jruby.jruby-complete.jar.path}" failonerror="true">... @ 6:100 in /Users/undees/src/ext/cujvm/jruby/target/antrun/build-main.xml
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException has occured: Java returned: 1
around Ant part ...<java fork="true" jar="${maven.dependency.org.jruby.jruby-complete.jar.path}" failonerror="true">... @ 6:100 in /Users/undees/src/ext/cujvm/jruby/target/antrun/build-main.xml
    at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:355)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: /Users/undees/src/ext/cujvm/jruby/target/antrun/build-main.xml:6: Java returned: 1
    at org.apache.tools.ant.taskdefs.Java.execute(Java.java:111)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:327)
    ... 21 more
[ERROR] 

@aslakhellesoy
Copy link
Contributor

Does this issue still apply? I'm unable to reproduce it, and so is Travis

@undees
Copy link
Contributor

undees commented Mar 18, 2012

I can confirm that the failure still happens as of c85cb6, no matter which Ruby rbenv is set to use (I've tried 1.8.7, 1.9.2, and JRuby). But if I remove all the rbenv directories from my $PATH, the build completes normally.

The installer appears to be trying to interpret the gem bash script as Ruby code.

@dkowis
Copy link
Member

dkowis commented Mar 18, 2012

It might be that we make sure we start with a clean environment. That would break certain environment variables, but it would guarantee that gem isn't being replaced. Or maybe just set the path to nothing. Jruby shouldn't care about the path. I haven't been able to reproduce it, but I can try changing it to clear the path, and if it still works for us "normal" people you guys can test it ;)

@aslakhellesoy
Copy link
Contributor

Does this still happen on master, rvm 1.18.5 or later and jruby 1.7.2 or later? If so, please reopen.

@aslakhellesoy
Copy link
Contributor

Ok, now that I have switched from rvm to rbenv I'm seeing this issue too. It
s rbenv/rbenv#76

@aslakhellesoy aslakhellesoy reopened this Jun 10, 2013
@aslakhellesoy
Copy link
Contributor

The simple solution is to make sure you don't have a gem command on your PATH, basically removing ~/.rbenv/shims from PATH.

@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants