2016-03-30 13 views
0

1.9.3p551 Ruby sürümünde (RVM'de) Rails 2.3.2 uygulaması üzerinde çalışıyorum. Bu eski uygulamayı çalıştırmaya çalıştığımda, bir "Psych Sözdizimi Hatası" alıyorum, komisyon db: migrate veya rake -v veya başka bir çalıştırdığımda hata alıyorum. Lütfen bana yardım et. Bende hata günlüğü geçerli:Psych Sözdizimi Rails 2.3.2 uygulaması çalışırken rake hatası

[email protected]:~/Desktop/practice/Application$ rake -v 
rake aborted! 
Psych::SyntaxError: (<unknown>): did not find expected node content while parsing a flow node at line 18 column 14 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:189:in `load_yml' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:176:in `load_file' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in `block in load_translations' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in `each' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in `load_translations' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:85:in `init_translations' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:74:in `available_locales' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:50:in `available_locales' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:215:in `valid_locale?' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:234:in `split' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:113:in `initialize' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:87:in `new' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:87:in `create_template' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:82:in `block in templates_in_path' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:81:in `each' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:81:in `templates_in_path' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:64:in `load!' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:49:in `block in new_and_loaded' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/core_ext/object/misc.rb:39:in `returning' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_view/template.rb:48:in `new_and_loaded' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:41:in `<module:Rescue>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:17:in `<module:ActionController>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:1:in `<top (required)>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_controller/base.rb:1406:in `block in <module:ActionController>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_controller/base.rb:1405:in `class_eval' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_controller/base.rb:1405:in `<module:ActionController>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/actionpack-2.3.2/lib/action_controller/base.rb:3:in `<top (required)>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/rails-2.3.2/lib/initializer.rb:446:in `initialize_framework_caches' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/rails-2.3.2/lib/initializer.rb:144:in `process' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/rails-2.3.2/lib/initializer.rb:113:in `run' 
/home/myuser/Desktop/practice/Application/config/environment.rb:9:in `<top (required)>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/rails-2.3.2/lib/tasks/misc.rake:4:in `block in <top (required)>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/rails-2.3.2/lib/tasks/testing.rake:45:in `block (2 levels) in <top (required)>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/rails-2.3.2/lib/tasks/testing.rake:43:in `collect' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/gems/rails-2.3.2/lib/tasks/testing.rake:43:in `block in <top (required)>' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval' 
/home/myuser/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>' 
Tasks: TOP => test:units => db:test:prepare => db:abort_if_pending_migrations => environment 
(See full trace by running task with --trace) 

cevap

0

O config/locales içinde bulunmaktadır yerelleştirme dosyalarından birinde bir sözdizimi hatası gibi görünüyor.

require 'yaml' 
Dir.glob("config/locales/*.yml").each do |f| 
    begin 
    YAML.load(File.read(f)) 
    rescue Psych::SyntaxError => e 
    puts "YAML syntax error in: #{f}" 
    puts e.message 
    end 
end 

Sen raylar kök directry bir dosyada bu yerleştirebilir ve çalıştırabilirsiniz ya: Eğer --trace ile görev çalıştıran deneyebilir veya dosyaların her biri ayrıştırma deneyebilirsiniz - iz dosyası isimlerini vermiyor ruby locale_linter.rb ile veya kopyayı normal irb konsoluna yapıştırın.

Syntax error in: config/locales/en.yml 
(<unknown>): did not find expected key while parsing a block mapping at line 23 column 3 
=> ["config/locales/en.yml"] 
:

çıktı kusurlu dosyasına işaret etmelidir

İlgili konular