JRuby无法运行的Rails应用程序 - Psych :: SyntaxError:(<unknown>)

时间:2016-07-21 10:10:02

标签: ruby-on-rails rubygems jruby

我有一个我正在运行的rails应用程序o sx 10.10.5当我尝试运行rails服务器时出现此错误:

Psych::SyntaxError: (<unknown>): found unexpected end of stream while scanning a quoted scalar at line 14 column 82
                             parse at org/jruby/ext/psych/PsychParser.java:227
                      parse_stream at /Users/fariedpatel1/.rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych.rb:376
                             parse at /Users/fariedpatel1/.rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych.rb:324
                              load at /Users/fariedpatel1/.rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych.rb:251
                             parse at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/application.rb:60
        block in raw_configuration at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/application.rb:56
                              call at org/jruby/RubyProc.java:318
                           default at org/jruby/RubyHash.java:712
                                [] at org/jruby/RubyHash.java:1100
                 raw_configuration at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/application.rb:56
              global_configuration at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/application.rb:64
                     configuration at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/application.rb:32
                              each at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/application.rb:42
                              load at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/application.rb:36
                              load at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro.rb:23
                  block in Railtie at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/figaro-1.1.1/lib/figaro/rails/railtie.rb:5
                              call at org/jruby/RubyProc.java:318
                      execute_hook at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/activesupport-4.2.7/lib/active_support/lazy_load_hooks.rb:36
           block in run_load_hooks at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/activesupport-4.2.7/lib/active_support/lazy_load_hooks.rb:45
                              each at org/jruby/RubyArray.java:1560
                    run_load_hooks at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/activesupport-4.2.7/lib/active_support/lazy_load_hooks.rb:44
                   run_load_hooks! at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/railties-4.2.7/lib/rails/application.rb:148
                          instance at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/railties-4.2.7/lib/rails/application.rb:96
                            config at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/railties-4.2.7/lib/rails/railtie.rb:123
               <class:Application> at /Users/fariedpatel1/Documents/Maestrano/connector/config/application.rb:11
                <module:Connector> at /Users/fariedpatel1/Documents/Maestrano/connector/config/application.rb:10
                             <top> at /Users/fariedpatel1/Documents/Maestrano/connector/config/application.rb:9
                           require at org/jruby/RubyKernel.java:937
                            (root) at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:1
 require_application_and_environment! at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:141
                           console at /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:67
                             <top> at    /Users/fariedpatel1/.rvm/gems/jruby-9.0.5.0@newconnector/gems/railties-4.2.7/lib/rails/commands/commands_tasks.rb:39
                        require at org/jruby/RubyKernel.java:937
                             <top> at bin/rails:4

我的宝石文件:

ruby '2.2.3', :engine => 'jruby', :engine_version => '9.0.5.0'
source 'https://rubygems.org'

gem 'rails', '~> 4.2.6'
gem 'turbolinks', '~> 2.5'
gem 'jquery-rails'
gem 'puma'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :jruby]
gem 'uglifier', '>= 1.3.0'
gem 'maestrano-connector-rails'
Object.send :remove_const, :Config
Config = RbConfig
group :production, :uat do
  gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
  gem 'pg', platforms: :ruby
  gem 'rails_12factor'
end

group :test, :develpment do
  gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
  gem 'sqlite3', platforms: :ruby
end

group :test do
  gem 'simplecov'
  gem 'rspec-rails'
  gem 'factory_girl_rails'
  gem 'shoulda-matchers'
  gem 'timecop'
end

我正在使用jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64] 和Rails 4.2.7

如果您需要有关我的设置的任何其他信息,请与我们联系。我设置了很多问题。我之前的错误显示我需要将配置更改为RB配置,因此您可以看到我将其包含在我的gemfile中,并且该特定错误消失了。

1 个答案:

答案 0 :(得分:0)

你的figaro .yml配置中只有一个语法错误(检查你的配置)。

您可以尝试解析文件以验证其有效:

require 'yaml'; YAML.load File.read('config/figaro.yml')

...这不是JRuby特定的问题,您可以通过在MRI下启动来确认