Сбой установки MySql с использованием Bundler + Capistrano + Rails 3 в Ubuntu 10.04 - PullRequest
0 голосов
/ 08 ноября 2011

Я запустил cap deploy и получил следующую проблему,

 ** [out :: 122.248.240.239] Installing mysql2 (0.3.7)
 ** [out :: 122.248.240.239] with native extensions
 ** [out :: 122.248.240.239] 
 ** [out :: 122.248.240.239] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
 ** [out :: 122.248.240.239] 
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
 ** [out :: 122.248.240.239] 
 ** [out :: 122.248.240.239] Gem files will remain installed in /var/www/iperpus/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.7 for inspection.
 ** [out :: 122.248.240.239] Results logged to /var/www/iperpus/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.7/ext/mysql2/gem_make.out
 ** [out :: 122.248.240.239] An error occured while installing mysql2 (0.3.7), and Bundler cannot continue.
 ** [out :: 122.248.240.239] Make sure that `gem install mysql2 -v '0.3.7'` succeeds before bundling.
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/installer.rb:80:in `rescue in install_gem_from_spec'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/installer.rb:61:in `install_gem_from_spec'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/installer.rb:50:in `block in run'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/installer.rb:49:in `run'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/installer.rb:8:in `install'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/cli.rb:219:in `install'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/vendor/thor/task.rb:22:in `run'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/vendor/thor.rb:263:in `dispatch'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/vendor/thor/base.rb:386:in `start'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/bin/bundle:13:in `<top (required)>'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/bin/bundle:19:in `load'
 ** [out :: 122.248.240.239] /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/bin/bundle:19:in `<main>'

Содержимое Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.0'

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

group :development, :test do
  gem 'sqlite3'
end

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

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn', :require => false
end

gem 'execjs'
gem 'therubyracer'

gem 'devise', "1.4.7"
gem "compass", ">= 0.11.5"
gem 'haml'
gem "oa-oauth", :require => "omniauth/oauth"

gem 'mysql2'
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'

gem 'sunspot'
gem 'sunspot_rails'

Внутри deploy.rb я уже добавил:

require "bundler/capistrano"

Я использую RVM 1.8.4, работающий на Ubuntu 10.04.Все зависимости MySQL были установлены.

Как ни странно, gem install mysql2 работает!Но установка пакета mysql2 не работает

В чем причина проблемы?

1 Ответ

2 голосов
/ 16 декабря 2011

Убедитесь, что у вас установлены библиотеки разработки клиента для mysql:

sudo apt-get install libmysqlclient-dev

...