【问题标题】:Error when trying to deploy project尝试部署项目时出错
【发布时间】:2014-11-03 14:26:27
【问题描述】:

我正在尝试将我的项目部署到我的 VPS。但是我遇到了这个错误:

INFO [6f651f60] Running ~/.rbenv/bin/rbenv exec bundle exec rake assets:precompile on 128.199.60.121
DEBUG [6f651f60] Command: cd /home/deploy/wisemonkeys/releases/20141103141543 && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 RAILS_ENV=production ~/.rbenv/bin/rbenv exec bundle exec rake assets:precompile )
DEBUG [6f651f60]    rake aborted!
DEBUG [6f651f60]    Psych::BadAlias: Unknown alias: default
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application/configuration.rb:106:in `database_configuration'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.2/lib/active_record/railtie.rb:175:in `block (2 levels) in <class:Railtie>'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:27:in `each'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.2/lib/active_record/railtie.rb:174:in `block in <class:Railtie>'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/releases/20141103141543/config/environment.rb:5:in `<top (required)>'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application.rb:250:in `block in run_tasks_blocks'
DEBUG [6f651f60]    /home/deploy/wisemonkeys/shared/bundle/ruby/2.1.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
DEBUG [6f651f60]    Tasks: TOP => environment
DEBUG [6f651f60]    (See full trace by running task with --trace)
cap aborted!
SSHKit::Command::Failed: rake stdout: Nothing written
rake stderr: Nothing written

如果我在我的 VPS 上运行 bundle exec rake assets:precompile 我会得到同样的错误。

如果我运行 bundle exec rake assets:precompile 本地,我会收到以下消息:

alucardu@alucardu-VirtualBox ~/sites/wisemonkeys (frontend-update *) $ rake assets:precompile
rake aborted!
Psych::BadAlias: Unknown alias: default
/home/alucardu/sites/wisemonkeys/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)

环境.rb

# Load the Rails application.
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
Wisemonkeys::Application.initialize!

【问题讨论】:

    标签: ruby-on-rails ruby deployment capistrano


    【解决方案1】:

    这似乎很重要:

    Psych::BadAlias: 未知别名:默认

    Psych 是一个 YAML 解析器。您最近是否编辑过一个 YAML 文件,该文件可能具有这样的别名引用:

    something:
      <<: *default
    

    但文件中没有定义default?也许你的database.mlsecrets.yml

    【讨论】:

      猜你喜欢
      • 2022-07-13
      • 1970-01-01
      • 1970-01-01
      • 2012-04-19
      • 2016-06-19
      • 2017-02-01
      • 1970-01-01
      • 2021-05-11
      相关资源
      最近更新 更多