0

大家好,我一直在尝试使用 capistrano 部署我的应用程序。但是我一直收到以下错误,不知道如何解决它。

* executing "cd /var/www/html/mysite.com/releases/20130224075438 && bundle install --gemfile /var/www/html/mysite.com/releases/20130224075438/Gemfile --path /var/www/html/mysite.com/shared/bundle --deployment --quiet --without development test"
    servers: ["166.78.22.204"]
    [166.78.22.204] executing command
 ** [out :: 166.78.22.204] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
 ** [out :: 166.78.22.204] 
 ** [out :: 166.78.22.204] /usr/local/bin/ruby extconf.rb
 ** [out :: 166.78.22.204] checking for pg_config... no
 ** [out :: 166.78.22.204] No pg_config... trying anyway. If building fails, please try again with
 ** [out :: 166.78.22.204] --with-pg-config=/path/to/pg_config
 ** [out :: 166.78.22.204] checking for libpq-fe.h... no
 ** [out :: 166.78.22.204] Can't find the 'libpq-fe.h header
 ** [out :: 166.78.22.204] *** extconf.rb failed ***
 ** [out :: 166.78.22.204] Could not create Makefile due to some reason, probably lack of
 ** [out :: 166.78.22.204] necessary libraries and/or headers.  Check the mkmf.log file for more
 ** [out :: 166.78.22.204] details.  You may need configuration options.
 ** [out :: 166.78.22.204] 
 ** [out :: 166.78.22.204] Provided configuration options:
 ** [out :: 166.78.22.204] --with-opt-dir
 ** [out :: 166.78.22.204] --with-opt-include
 ** [out :: 166.78.22.204] --without-opt-include=${opt-dir}/include
 ** [out :: 166.78.22.204] --with-opt-lib
 ** [out :: 166.78.22.204] --without-opt-lib=${opt-dir}/lib
 ** [out :: 166.78.22.204] --with-make-prog
 ** [out :: 166.78.22.204] --without-make-prog
 ** [out :: 166.78.22.204] --srcdir=.
 ** [out :: 166.78.22.204] --curdir
 ** [out :: 166.78.22.204] --ruby=/usr/local/bin/ruby
 ** [out :: 166.78.22.204] --with-pg
 ** [out :: 166.78.22.204] --without-pg
 ** [out :: 166.78.22.204] --with-pg-dir
 ** [out :: 166.78.22.204] --without-pg-dir
 ** [out :: 166.78.22.204] --with-pg-include
 ** [out :: 166.78.22.204] --without-pg-include=${pg-dir}/include
 ** [out :: 166.78.22.204] --with-pg-lib
 ** [out :: 166.78.22.204] --without-pg-lib=${pg-dir}/lib
 ** [out :: 166.78.22.204] --with-pg-config
 ** [out :: 166.78.22.204] --without-pg-config
 ** [out :: 166.78.22.204] --with-pg_config
 ** [out :: 166.78.22.204] --without-pg_config
 ** [out :: 166.78.22.204] 
 ** [out :: 166.78.22.204] 
 ** [out :: 166.78.22.204] Gem files will remain installed in /var/www/html/mysite.com/shared/bundle/ruby/1.9.1/gems/pg-0.14.1 for inspection.
 ** [out :: 166.78.22.204] Results logged to /var/www/html/mysite.com/shared/bundle/ruby/1.9.1/gems/pg-0.14.1/ext/gem_make.out
 ** [out :: 166.78.22.204] An error occurred while installing pg (0.14.1), and Bundler cannot continue.
 ** [out :: 166.78.22.204] Make sure that `gem install pg -v '0.14.1'` succeeds before bundling.
    command finished in 95532ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/html/mysite.com/releases/20130224075438; true"
    servers: ["166.78.22.204"]
    [166.78.22.204] executing command
    command finished in 712ms
failed: "sh -c 'cd /var/www/html/mysite.com/releases/20130224075438 && bundle install --gemfile /var/www/html/fltctr.com/releases/20130224075438/Gemfile --path /var/www/html/fltctr.com/shared/bundle --deployment --quiet --without development test'" on 166.78.22.204

我可以说 pg 无法安装,但是我的应用程序使用的是 mysql 而根本不是 pg。这是我的宝石文件。

require 'rbconfig'
HOST_OS = RbConfig::CONFIG['host_os']
source 'https://rubygems.org'

gem 'rails', '3.2.3'

gem 'mysql2'

gem 'activerecord-postgresql-adapter'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem "thin", ">= 1.5.0", :group => :production
gem "haml", ">= 3.1.7"
gem "haml-rails", ">= 0.3.5", :group => :development
gem "hpricot", ">= 0.8.6", :group => :development
gem "ruby_parser", ">= 3.1.1", :group => :development
gem "rspec-rails", ">= 2.11.4", :group => [:development, :test]
gem "database_cleaner", ">= 0.9.1", :group => :test
gem "email_spec", ">= 1.4.0", :group => :test
gem "cucumber-rails", ">= 1.3.0", :group => :test, :require => false
gem "launchy", ">= 2.1.2", :group => :test
gem "capybara", ">= 2.0.1", :group => :test
gem "factory_girl_rails", ">= 4.1.0", :group => [:development, :test]
gem "bootstrap-sass", ">= 2.2.2.0"
gem "devise", ">= 2.1.2"
gem "cancan", ">= 1.6.8"
gem "rolify", ">= 3.2.0"
gem "simple_form", ">= 2.0.4"
gem "quiet_assets", ">= 1.0.1", :group => :development
gem "figaro", ">= 0.5.0"
gem "better_errors", ">= 0.3.2", :group => :development
gem "binding_of_caller", ">= 0.6.8", :group => :development
gem "libv8", ">= 3.11.8"
gem "therubyracer", ">= 0.11.0", :group => :assets, :platform => :ruby, :require => "v8"
#gem 'wkhtmltopdf'
#gem 'wicked_pdf'
gem "handles_sortable_columns"

#custom gems go here
gem 'best_in_place'
gem 'bootstrap-datepicker-rails'
gem 'state_machine'
gem 'bootswatch-rails'
gem 'acts_as_commentable'
#gem 'wkhtmltopdf-binary'
#gem "pdfkit"  
gem 'kaminari'
gem 'has_scope'
#gem 'class-table-inheritance'
gem 'citier'
gem 'rails_sql_views', :git => 'git://github.com/DouweM/rails_sql_views.git'#,  :git=>'git://github.com/flwyd/rails_sql_views.git' #'git://github.com/DouweM/rails_sql_views.git' #'git://github.com/morgz/rails_sql_views.git' #
gem 'country_select'

group :development do
  gem 'rack-mini-profiler'
  gem 'spork', '~> 1.0rc'
  gem "guard", ">= 0.6.2"
  gem 'guard-spork'
  gem 'guard-livereload'
  gem "guard-bundler", ">= 0.1.3"
  gem "guard-rails", ">= 0.0.3"
  gem "guard-rspec", ">= 0.4.3"
  gem "guard-cucumber", ">= 0.6.1"
  case HOST_OS
  when /darwin/i
    gem 'rb-fsevent'
    gem 'growl'
  when /linux/i
    gem 'libnotify'
    gem 'rb-inotify'
  when /mswin|windows/i
    gem 'rb-fchange'
    gem 'win32console'
    gem 'rb-notifu'
  end
end

group :test do
  gem "shoulda-matchers"
  gem 'simplecov', :require => false

end

我正在部署到云服务器 - 关于可能出现问题的任何想法?每次我使用时都会发生这种情况cap deploy

这是我的 Gemfile.lock

    GIT
  remote: git://github.com/DouweM/rails_sql_views.git
  revision: 0cf1af369a5f6553d33c90a13d331ea49e607d26
  specs:
    rails_sql_views (0.8.0.epublishing)
      activerecord

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.3)
      actionpack (= 3.2.3)
      mail (~> 2.4.4)
    actionpack (3.2.3)
      activemodel (= 3.2.3)
      activesupport (= 3.2.3)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.1)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.1.2)
    activemodel (3.2.3)
      activesupport (= 3.2.3)
      builder (~> 3.0.0)
    activerecord (3.2.3)
      activemodel (= 3.2.3)
      activesupport (= 3.2.3)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activerecord-postgresql-adapter (0.0.1)
      pg
    activeresource (3.2.3)
      activemodel (= 3.2.3)
      activesupport (= 3.2.3)
    activesupport (3.2.3)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    acts_as_commentable (4.0.0)
    addressable (2.3.3)
    arel (3.0.2)
    bcrypt-ruby (3.0.1)
    best_in_place (2.1.0)
      jquery-rails
      rails (~> 3.1)
    better_errors (0.6.0)
      coderay (>= 1.0.0)
      erubis (>= 2.6.6)
    binding_of_caller (0.7.1)
      debug_inspector (>= 0.0.1)
    bootstrap-datepicker-rails (0.6.42)
      railties (>= 3.0)
    bootstrap-sass (2.3.0.1)
      sass (~> 3.2)
    bootswatch-rails (0.4.0)
      railties (>= 3.1)
    bourne (1.1.2)
      mocha (= 0.10.5)
    builder (3.0.4)
    cancan (1.6.9)
    capybara (2.0.2)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      selenium-webdriver (~> 2.0)
      xpath (~> 1.0.0)
    childprocess (0.3.8)
      ffi (~> 1.0, >= 1.0.11)
    citier (0.1.15)
      rails_sql_views
    coderay (1.0.9)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.4.0)
    country_select (1.1.3)
    cucumber (1.2.1)
      builder (>= 2.1.2)
      diff-lcs (>= 1.1.3)
      gherkin (~> 2.11.0)
      json (>= 1.4.6)
    cucumber-rails (1.3.0)
      capybara (>= 1.1.2)
      cucumber (>= 1.1.8)
      nokogiri (>= 1.5.0)
    daemons (1.1.9)
    database_cleaner (0.9.1)
    debug_inspector (0.0.2)
    devise (2.2.3)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (~> 3.1)
      warden (~> 1.2.1)
    diff-lcs (1.1.3)
    em-websocket (0.4.0)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0.5.3)
    email_spec (1.4.0)
      launchy (~> 2.1)
      mail (~> 2.2)
    erubis (2.7.0)
    eventmachine (1.0.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    factory_girl (4.2.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.2.1)
      factory_girl (~> 4.2.0)
      railties (>= 3.0.0)
    ffi (1.4.0)
    figaro (0.5.4)
      rails (~> 3.0)
    gherkin (2.11.6)
      json (>= 1.7.6)
    guard (1.6.2)
      listen (>= 0.6.0)
      lumberjack (>= 1.0.2)
      pry (>= 0.9.10)
      terminal-table (>= 1.4.3)
      thor (>= 0.14.6)
    guard-bundler (1.0.0)
      bundler (~> 1.0)
      guard (~> 1.1)
    guard-cucumber (1.3.2)
      cucumber (>= 1.2.0)
      guard (>= 1.1.0)
    guard-livereload (1.1.3)
      em-websocket (>= 0.2.0)
      guard (>= 1.5.0)
      multi_json (~> 1.0)
    guard-rails (0.3.1)
      guard (>= 0.2.2)
      version (>= 1.0.0)
    guard-rspec (2.4.1)
      guard (>= 1.1)
      rspec (~> 2.11)
    guard-spork (1.4.2)
      childprocess (>= 0.2.3)
      guard (>= 1.1)
      spork (>= 0.8.4)
    haml (4.0.0)
      tilt
    haml-rails (0.4)
      actionpack (>= 3.1, < 4.1)
      activesupport (>= 3.1, < 4.1)
      haml (>= 3.1, < 4.1)
      railties (>= 3.1, < 4.1)
    handles_sortable_columns (0.1.3)
    has_scope (0.5.1)
    hike (1.2.1)
    hpricot (0.8.6)
    http_parser.rb (0.5.3)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (2.2.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (4.0.1)
      jquery-rails
      railties (>= 3.1.0)
    json (1.7.7)
    kaminari (0.14.1)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    launchy (2.2.0)
      addressable (~> 2.3)
    libnotify (0.8.0)
      ffi (>= 1.0.11)
    libv8 (3.11.8.13)
    listen (0.7.2)
    lumberjack (1.0.2)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    metaclass (0.0.1)
    method_source (0.8.1)
    mime-types (1.21)
    mocha (0.10.5)
      metaclass (~> 0.0.1)
    multi_json (1.6.1)
    mysql2 (0.3.11)
    nokogiri (1.5.6)
    orm_adapter (0.4.0)
    pg (0.14.1)
    polyglot (0.3.3)
    pry (0.9.12)
      coderay (~> 1.0.5)
      method_source (~> 0.8)
      slop (~> 3.4)
    quiet_assets (1.0.2)
      railties (>= 3.1, < 5.0)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-mini-profiler (0.1.23)
      rack (>= 1.1.3)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.3)
      actionmailer (= 3.2.3)
      actionpack (= 3.2.3)
      activerecord (= 3.2.3)
      activeresource (= 3.2.3)
      activesupport (= 3.2.3)
      bundler (~> 1.0)
      railties (= 3.2.3)
    railties (3.2.3)
      actionpack (= 3.2.3)
      activesupport (= 3.2.3)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)
    rake (10.0.3)
    rb-inotify (0.9.0)
      ffi (>= 0.5.0)
    rdoc (3.12.1)
      json (~> 1.4)
    ref (1.0.2)
    rolify (3.2.0)
    rspec (2.12.0)
      rspec-core (~> 2.12.0)
      rspec-expectations (~> 2.12.0)
      rspec-mocks (~> 2.12.0)
    rspec-core (2.12.2)
    rspec-expectations (2.12.1)
      diff-lcs (~> 1.1.3)
    rspec-mocks (2.12.2)
    rspec-rails (2.12.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 2.12.0)
      rspec-expectations (~> 2.12.0)
      rspec-mocks (~> 2.12.0)
    ruby_parser (3.1.1)
      sexp_processor (~> 4.1)
    rubyzip (0.9.9)
    sass (3.2.6)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    selenium-webdriver (2.30.0)
      childprocess (>= 0.2.5)
      multi_json (~> 1.0)
      rubyzip
      websocket (~> 1.0.4)
    sexp_processor (4.1.5)
    shoulda-matchers (1.4.2)
      activesupport (>= 3.0.0)
      bourne (~> 1.1.2)
    simple_form (2.0.4)
      actionpack (~> 3.0)
      activemodel (~> 3.0)
    simplecov (0.7.1)
      multi_json (~> 1.0)
      simplecov-html (~> 0.7.1)
    simplecov-html (0.7.1)
    slop (3.4.3)
    spork (1.0.0rc3)
    sprockets (2.1.2)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    state_machine (1.1.2)
    terminal-table (1.4.5)
    therubyracer (0.11.3)
      libv8 (~> 3.11.8.12)
      ref
    thin (1.5.0)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.35)
    uglifier (1.3.0)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    version (1.0.0)
    warden (1.2.1)
      rack (>= 1.0)
    websocket (1.0.7)
    xpath (1.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  activerecord-postgresql-adapter
  acts_as_commentable
  best_in_place
  better_errors (>= 0.3.2)
  binding_of_caller (>= 0.6.8)
  bootstrap-datepicker-rails
  bootstrap-sass (>= 2.2.2.0)
  bootswatch-rails
  cancan (>= 1.6.8)
  capybara (>= 2.0.1)
  citier
  coffee-rails (~> 3.2.1)
  country_select
  cucumber-rails (>= 1.3.0)
  database_cleaner (>= 0.9.1)
  devise (>= 2.1.2)
  email_spec (>= 1.4.0)
  factory_girl_rails (>= 4.1.0)
  figaro (>= 0.5.0)
  guard (>= 0.6.2)
  guard-bundler (>= 0.1.3)
  guard-cucumber (>= 0.6.1)
  guard-livereload
  guard-rails (>= 0.0.3)
  guard-rspec (>= 0.4.3)
  guard-spork
  haml (>= 3.1.7)
  haml-rails (>= 0.3.5)
  handles_sortable_columns
  has_scope
  hpricot (>= 0.8.6)
  jquery-rails
  jquery-ui-rails
  kaminari
  launchy (>= 2.1.2)
  libnotify
  libv8 (>= 3.11.8)
  mysql2
  quiet_assets (>= 1.0.1)
  rack-mini-profiler
  rails (= 3.2.3)
  rails_sql_views!
  rb-inotify
  rolify (>= 3.2.0)
  rspec-rails (>= 2.11.4)
  ruby_parser (>= 3.1.1)
  sass-rails (~> 3.2.3)
  shoulda-matchers
  simple_form (>= 2.0.4)
  simplecov
  spork (~> 1.0rc)
  state_machine
  therubyracer (>= 0.11.0)
  thin (>= 1.5.0)
  uglifier (>= 1.0.3)
4

1 回答 1

1

您的 Gemfile 包括activerecord-postgresql-adapter哪些取决于 pg gem。

于 2013-02-24T10:28:55.300 回答