【问题标题】:Deploying rails app Capistrano plenty ERRORS部署 Rails 应用 Capistrano 大量错误
【发布时间】:2013-01-24 22:55:58
【问题描述】:

我第一次尝试在 vexxhost 上部署我的 rails 应用程序。我使用 github 作为我的源代码管理和 capistrano。

这是我的部署文件

   require 'bundler/capistrano'
   require 'capistrano'
   require 'bundler'
   require 'capistrano-vexxhost'

   # Account Settings

   ssh_options[:forward_agent] = true
   set :scm_command, "/home/user/opt/bin/git"
   set :local_scm_command,"git"
   set :user, "xxxxxxxx"
   set :password, "xxxxxxxxx"
   set :domain, "domain.com"
   set :mount_path,"/home/xxxxxxxx/xxxxxxx"
   set :application,"app name"
   set :scm, :git
   set :deploy_via, :copy
   set :repository, "git@github.com:xxxxx/xxxxxxx.git"
   default_run_options[:pty] = true

问题 1)

当我安装 gem 'capistrano' gem 'capistrano-vexxhost' 时,我在尝试在本地运行我的应用程序时遇到了以下错误(它在安装 capistrano 之前正在工作)。

 C:/Ruby193/lib/ruby/gems/1.9.1/gems/capistrano-2.14.1/lib/capistrano/configuration/loading.rb:18:in `instance': Please require this file from within a Capistrano recipe (LoadError)
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/capistrano-vexxhost-1.0.3/lib/capistrano-vexxhost/capistrano_integration.rb:6:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/capistrano-vexxhost-1.0.3/lib/capistrano-vexxhost.rb:2:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/capistrano-vexxhost-1.0.3/lib/capistrano-vexxhost.rb:2:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
    from C:/Users/mummy/LagoAds/config/application.rb:9:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in     `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

注意 但是,当我在 application.rb 文件中的以下代码中注释 Bundler.require 行时,它会成功运行,但无法识别宝石

  if defined?(Bundler)
  # If you precompile assets before deploying to production, use this line
  Bundler.require(*Rails.groups(:assets => %w(development test)))
  # If you want your assets lazily compiled in production, use this line
  # Bundler.require(:default, :assets, Rails.env)
  end

问题 2) 什么时候在我的 ruby​​ 命令提示符上键入“cap deploy:check”我得到以下错误。

问题 3) 什么时候在我的 ruby​​ 命令提示符下键入“cap deploy:cold”我收到以下错误

我的 deploy.rb 中是否缺少任何内容,或者有什么我没有做的。

请帮助我,我已经解决这个问题很长时间了。我是部署 Web 应用程序的新手,而且 Rails 对我来说非常困难

请帮忙

【问题讨论】:

    标签: windows git ruby-on-rails-3.1 github capistrano


    【解决方案1】:

    问题 2 和 3 您的第二个和第三个问题是 git 和 tar 不在您的路径中的结果。要么根本没有安装它们,要么你的路径不完整。请参阅我在下面引用的错误。

    问题 2

     'git' could not be found on the local host
     'tar' could not be found on the local host
    

    问题 3

     no such file or directory git ls-remote...
    

    问题 1

    很遗憾,我对#1 没有答案。猜测是您需要将capistrano 和/或capistrano-vexxhost 添加到您的deploy.rb

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-08
      • 1970-01-01
      • 1970-01-01
      • 2016-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多