`rvm install jruby`因Psych :: SyntaxError而失败

时间:2014-01-04 17:59:03

标签: rvm jruby

为了尝试开始使用jruby上的rails项目,我从昨天开始就尝试使用rvm到rvm install jruby,并且对于通常出现以下形式的错误感到很沮丧:

Psych::SyntaxError: (<unknown>): found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)

Here是完整日志的受害者,以防在那里找到任何有用的信息。

Herervm install ruby的更新版本(没有--1.9参数)。

~./gemrc的内容:

install:    --no-rdoc   --no-ri
update:     --no-rdoc   --no-ri

/etc/gemrc是空白的。

以下是安装日志rubygems.install.log

[2014-01-05 19:22:32] /home/petey/.rvm/rubies/jruby-1.7.9/bin/ruby
current path: /home/petey/.rvm/src/rubygems-2.2.0
GEM_HOME=/home/petey/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0
PATH=/home/petey/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/bin:/home/petey/.rvm/gems/ruby-2.0.0-p247@global/bin:/home/petey/.rvm/rubies/ruby-2.0.0-p247/bin:/home/petey/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
GEM_PATH=/home/petey/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0:/home/petey/.rvm/gems/ruby-2.0.0-p247@global
command(6): env GEM_PATH=/home/petey/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0:/home/petey/.rvm/gems/ruby-2.0.0-p247@global:/home/petey/.rvm/gems/ruby-2.0.0-p247@global GEM_HOME=/home/petey/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0 /home/petey/.rvm/rubies/jruby-1.7.9/bin/ruby -d /home/petey/.rvm/src/rubygems-2.2.0/setup.rb
java.lang.ClassNotFoundException: rubygems.defaults.OperatingSystemService
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at org.jruby.util.JRubyClassLoader.findClass(JRubyClassLoader.java:128)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:270)
  at org.jruby.javasupport.JavaSupport.loadJavaClass(JavaSupport.java:166)
  at org.jruby.runtime.load.LoadService$ExtensionSearcher.trySearch(LoadService.java:814)
  at org.jruby.runtime.load.LoadService.findFileForLoad(LoadService.java:411)
  at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:560)
  at org.jruby.runtime.load.LoadService.requireCommon(LoadService.java:457)
  at org.jruby.runtime.load.LoadService.require(LoadService.java:421)
  at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1089)
  at org.jruby.RubyKernel.require19(RubyKernel.java:1083)
  at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
  at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350)
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
  at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
  at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  at org.jruby.ast.IfNode.interpret(IfNode.java:118)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  at org.jruby.ast.RootNode.interpret(RootNode.java:129)
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
  at org.jruby.Ruby.runInterpreter(Ruby.java:838)
  at org.jruby.Ruby.loadFile(Ruby.java:2727)
  at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
  at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:959)
  at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:573)
  at org.jruby.runtime.load.LoadService.requireCommon(LoadService.java:457)
  at org.jruby.runtime.load.LoadService.require(LoadService.java:421)
  at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1089)
  at org.jruby.RubyKernel.require19(RubyKernel.java:1083)
  at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
  at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350)
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
  at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
  at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.RootNode.interpret(RootNode.java:129)
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
  at org.jruby.Ruby.runInterpreter(Ruby.java:838)
  at org.jruby.Ruby.loadFile(Ruby.java:2727)
  at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
  at org.jruby.runtime.load.LoadService.load(LoadService.java:359)
  at org.jruby.RubyKernel.loadCommon(RubyKernel.java:1107)
  at org.jruby.RubyKernel.load19(RubyKernel.java:1099)
  at org.jruby.RubyKernel$INVOKER$s$0$1$load19.call(RubyKernel$INVOKER$s$0$1$load19.gen)
  at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
  at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
  at org.jruby.ast.IfNode.interpret(IfNode.java:118)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  at org.jruby.ast.RootNode.interpret(RootNode.java:129)
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
  at org.jruby.Ruby.runInterpreter(Ruby.java:838)
  at org.jruby.Ruby.loadFile(Ruby.java:2727)
  at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
  at org.jruby.runtime.load.LoadService.loadFromClassLoader(LoadService.java:385)
  at org.jruby.Ruby.initRubyKernel(Ruby.java:1722)
  at org.jruby.Ruby.init(Ruby.java:1201)
  at org.jruby.Ruby.newInstance(Ruby.java:278)
  at org.jruby.Main.internalRun(Main.java:258)
  at org.jruby.Main.run(Main.java:217)
  at org.jruby.Main.main(Main.java:197)
java.lang.ClassNotFoundException: rubygems.defaults.JrubyNativeService
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at org.jruby.util.JRubyClassLoader.findClass(JRubyClassLoader.java:128)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:270)
  at org.jruby.javasupport.JavaSupport.loadJavaClass(JavaSupport.java:166)
  at org.jruby.runtime.load.LoadService$ExtensionSearcher.trySearch(LoadService.java:814)
  at org.jruby.runtime.load.LoadService.findFileForLoad(LoadService.java:411)
  at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:560)
  at org.jruby.runtime.load.LoadService.requireCommon(LoadService.java:457)
  at org.jruby.runtime.load.LoadService.require(LoadService.java:421)
  at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1089)
  at org.jruby.RubyKernel.require19(RubyKernel.java:1083)
  at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
  at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350)
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
  at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
  at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  at org.jruby.ast.RootNode.interpret(RootNode.java:129)
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
  at org.jruby.Ruby.runInterpreter(Ruby.java:838)
  at org.jruby.Ruby.loadFile(Ruby.java:2727)
  at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
  at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:959)
  at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:573)
  at org.jruby.runtime.load.LoadService.requireCommon(LoadService.java:457)
  at org.jruby.runtime.load.LoadService.require(LoadService.java:421)
  at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1089)
  at org.jruby.RubyKernel.require19(RubyKernel.java:1083)
  at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
  at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350)
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
  at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
  at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.IfNode.interpret(IfNode.java:116)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  at org.jruby.ast.IfNode.interpret(IfNode.java:118)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  at org.jruby.ast.RootNode.interpret(RootNode.java:129)
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
  at org.jruby.Ruby.runInterpreter(Ruby.java:838)
  at org.jruby.Ruby.loadFile(Ruby.java:2727)
  at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
  at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:959)
  at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:573)
  at org.jruby.runtime.load.LoadService.requireCommon(LoadService.java:457)
  at org.jruby.runtime.load.LoadService.require(LoadService.java:421)
  at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1089)
  at org.jruby.RubyKernel.require19(RubyKernel.java:1083)
  at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
  at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350)
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
  at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
  at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.RootNode.interpret(RootNode.java:129)
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
  at org.jruby.Ruby.runInterpreter(Ruby.java:838)
  at org.jruby.Ruby.loadFile(Ruby.java:2727)
  at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
  at org.jruby.runtime.load.LoadService.load(LoadService.java:359)
  at org.jruby.RubyKernel.loadCommon(RubyKernel.java:1107)
  at org.jruby.RubyKernel.load19(RubyKernel.java:1099)
  at org.jruby.RubyKernel$INVOKER$s$0$1$load19.call(RubyKernel$INVOKER$s$0$1$load19.gen)
  at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
  at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
  at org.jruby.ast.IfNode.interpret(IfNode.java:118)
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
  at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
  at org.jruby.ast.RootNode.interpret(RootNode.java:129)
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
  at org.jruby.Ruby.runInterpreter(Ruby.java:838)
  at org.jruby.Ruby.loadFile(Ruby.java:2727)
  at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
  at org.jruby.runtime.load.LoadService.loadFromClassLoader(LoadService.java:385)
  at org.jruby.Ruby.initRubyKernel(Ruby.java:1722)
  at org.jruby.Ruby.init(Ruby.java:1201)
  at org.jruby.Ruby.newInstance(Ruby.java:278)
  at org.jruby.Main.internalRun(Main.java:258)
  at org.jruby.Main.run(Main.java:217)
  at org.jruby.Main.main(Main.java:197)
Psych::SyntaxError: (<unknown>): found character   '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation) while scanning for the next token at line 1 column 9
             parse at org/jruby/ext/psych/PsychParser.java:215
      parse_stream at /home/petey/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/psych.rb:205
             parse at /home/petey/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/psych.rb:153
              load at /home/petey/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/psych.rb:129
         load_file at /home/petey/.rvm/src/rubygems-2.2.0/lib/rubygems/config_file.rb:332
        initialize at /home/petey/.rvm/src/rubygems-2.2.0/lib/rubygems/config_file.rb:197
  do_configuration at /home/petey/.rvm/src/rubygems-2.2.0/lib/rubygems/gem_runner.rb:74
               run at /home/petey/.rvm/src/rubygems-2.2.0/lib/rubygems/gem_runner.rb:39
            (root) at setup.rb:45

1 个答案:

答案 0 :(得分:0)

~./gemrc包含:

install:    --no-rdoc   --no-ri
update:     --no-rdoc   --no-ri

删除标签并用空格替换它们可以解决问题。