2013-01-15 40 views
0

我試圖部署一個rails 3.2.11應用程序到bluehost共享主機使用capistrano。我不斷收到此錯誤Rails 3 Capistrano部署錯誤(在...解析塊節點)

[myapp.com] executing command 
*** [err :: myapp.com] rake aborted! 
*** [err :: myapp.com] (<unknown>): did not find expected node content while parsing a block node at line 18 column 13 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application/configuration.rb:115:in `database_configuration' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/railtie.rb:78:in `block (2 levels) in <class:Railtie>' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:25:in `each' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:25:in `on_load' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/railtie.rb:74:in `block in <class:Railtie>' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/releases/20130115050636/config/environment.rb:5:in `<top (required)>' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:103:in `require_environment!' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task' 
*** [err :: myapp.com] /home2/myappc/rails_apps/myapp/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>' 

錯誤說(<unknown>): did not find expected node content while parsing a block node at line 18 column 13,但我不知道是哪個文件它實際上指的是。

這是在日誌文件行4 database_configuration上述

# Loads and returns the contents of the #database_configuration_file. The 
     # contents of the file are processed via ERB before being sent through  
     # YAML::load.                
     def database_configuration 
     require 'erb' 
     YAML::load(ERB.new(IO.read(paths["config/database"].first)).result) 
     end 

我環顧四周,這可能是YAML解析錯誤。 於是,我就用這個在IRB,看是否有.yml文件引起的麻煩

YAML.load_file("filename.yml") 

但他們都變成罰款。

這是我的Gemfile,如果它需要

gem 'rails', '3.2.11' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'devise' 
gem 'friendly_id', "~> 4.0.9"#, :git => "git://github.com/norman/friendly_id.git" 
gem 'simple_form' 
gem 'json' 
gem 'cancan' 
gem 'rqrcode-rails3' #imageqrcodes 
gem 'mini_magick' 
gem "breadcrumbs_on_rails" 

group :production do 
    gem 'pg' 
    # gem 'thin' # Server used in production 
end 

group :development, :test do 
    gem 'mysql2' 
    gem 'capistrano' 
    gem 'rvm-capistrano' 
end 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer', :platforms => :ruby 

    gem 'uglifier', '>= 1.0.3' 
    gem 'twitter-bootstrap-rails' 
    gem 'execjs', '1.4.0' 
    gem 'therubyracer', :platforms => :ruby 
end 

gem 'jquery-rails' 
+0

可能是'rake'版本的問題。你可以在沒有錯誤的情況下運行任何rake命令嗎?嘗試運行'rake db:migrate:status' –

+0

當你運行YAML :: load(ERB.new(IO.read(paths [「config/database」]。)。)result)'in irb? – Amir

+0

@AmirF它說'NameError:未初始化的常量ERB' – Firyn

回答

0

的問題是,在我的database.yml文件。我的密碼以符號開頭。我無法找到逃避它的方法,所以我改變了它,現在它就像一種魅力。