gpt4 book ai didi

在 Ubuntu 10.04 上使用 Bundler + Capistrano + Rails 3 安装 MySql 失败

转载 作者:行者123 更新时间:2023-11-29 09:02:53 29 4
gpt4 key购买 nike

我运行 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 有效!但 bundle 安装 mysql2 不起作用

问题的根源是什么?

最佳答案

确保您安装了 mysql 的客户端开发库:

sudo apt-get install libmysqlclient-dev

关于在 Ubuntu 10.04 上使用 Bundler + Capistrano + Rails 3 安装 MySql 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8052918/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com