ローカルのVagrantからcapistoranoでさくらVPSにデプロイをしようとしています。
LoadError: libmysqlclient.so.18が出てきてpumaが起動しません。
参考ファイルは以下に添付します。ご教授お願いします。
deploy.rb
# config valid for current version and patch releases of Capistrano lock "~> 3.10.1" set :application, "rails_api" set :repo_url, "https://github.com/tomoyoshi-de/rails_api.git" # Default branch is :master ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp # Default deploy_to directory is /var/www/my_app_name set :deploy_to, "/var/www/rails_api" # Default value for :format is :airbrussh. # set :format, :airbrussh # You can configure the Airbrussh format using :format_options. # These are the defaults. # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto # Default value for :pty is false # set :pty, true # Default value for :linked_files is [] append :linked_files, "config/database.yml", "config/secrets.yml", 'config/cable.yml' # Default value for linked_dirs is [] append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system" set :rbenv_ruby, '2.5.0' set :puma_pid, "#{shared_path}/tmp/pids/puma.pid" namespace :puma do desc 'Create Directories for Puma Pids and Socket' task :make_dirs do on roles(:app) do execute "mkdir #{shared_path}/tmp/sockets -p" execute "mkdir #{shared_path}/tmp/pids -p" end end before :start, :make_dirs end namespace :deploy do after :restart, :clear_cache do on roles(:web), in: :groups, limit: 3, wait: 10 do # Here we can do anything such as: # within release_path do # execute :rake, 'cache:clear' # end end end end namespace :upload do %w(database secrets cable).each do |name| desc "upload config/#{name}.yml" task :"#{name}" do on roles(:app), in: :sequence do |host| execute :mkdir, '-p', "#{shared_path}/config" upload!("config/#{name}.yml","#{shared_path}/config/#{name}.yml") end end end end # Default value for default_env is {} # set :default_env, { path: "/opt/ruby/bin:$PATH" } # Default value for local_user is ENV['USER'] # set :local_user, -> { `git config user.name`.chomp } # Default value for keep_releases is 5 # set :keep_releases, 5 # Uncomment the following to require manually verifying the host key before first deploy. # set :ssh_options, verify_host_key: :secure
Capfile
# Load DSL and set up stages require "capistrano/setup" # Include default deployment tasks require "capistrano/deploy" # Load the SCM plugin appropriate to your project: # # require "capistrano/scm/hg" # install_plugin Capistrano::SCM::Hg # or # require "capistrano/scm/svn" # install_plugin Capistrano::SCM::Svn # or require "capistrano/scm/git" install_plugin Capistrano::SCM::Git # Include tasks from other gems included in your Gemfile # # For documentation on these, see for example: # # https://github.com/capistrano/rvm # https://github.com/capistrano/rbenv # https://github.com/capistrano/chruby # https://github.com/capistrano/bundler # https://github.com/capistrano/rails # https://github.com/capistrano/passenger # # require "capistrano/rvm" require "capistrano/rbenv" # require "capistrano/chruby" require "capistrano/bundler" #require "capistrano/rails/assets" require "capistrano/rails/migrations" # require "capistrano/passenger" require 'capistrano/puma' install_plugin Capistrano::Puma # Load custom tasks from `lib/capistrano/tasks` if you have any defined Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
エラーメッセージは以下です。
=== puma startup: 2018-01-07 10:13:10 +0900 ===
LoadError: libmysqlclient.so.18: cannot open shared object file: No such file or directory - /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.so
/var/www/rails_api/shared/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2.rb:31:in require' /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2.rb:31:in
<top (required)>'
/home/tomoyoshi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in require' /home/tomoyoshi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in
block (2 levels) in require'
/home/tomoyoshi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in each' /home/tomoyoshi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in
block in require'
/home/tomoyoshi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in each' /home/tomoyoshi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in
require'
/home/tomoyoshi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler.rb:114:in require' /var/www/rails_api/releases/20180107005503/config/application.rb:17:in
<top (required)>'
/var/www/rails_api/current/config/environment.rb:2:in require_relative' /var/www/rails_api/current/config/environment.rb:2:in
<top (required)>'
/var/www/rails_api/current/config.ru:3:in require_relative' /var/www/rails_api/current/config.ru:3:in
block in <main>'
/var/www/rails_api/shared/bundle/ruby/2.5.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in instance_eval' /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in
initialize'
/var/www/rails_api/current/config.ru:in new' /var/www/rails_api/current/config.ru:in
<main>'
/var/www/rails_api/shared/bundle/ruby/2.5.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in eval' /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in
new_from_string'
/var/www/rails_api/shared/bundle/ruby/2.5.0/gems/rack-2.0.3/lib/rack/builder.rb:40:in parse_file' /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/puma-3.11.0/lib/puma/configuration.rb:318:in
load_rackup'
/var/www/rails_api/shared/bundle/ruby/2.5.0/gems/puma-3.11.0/lib/puma/configuration.rb:243:in app' /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/puma-3.11.0/lib/puma/runner.rb:138:in
load_and_bind'
/var/www/rails_api/shared/bundle/ruby/2.5.0/gems/puma-3.11.0/lib/puma/single.rb:87:in run' /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/puma-3.11.0/lib/puma/launcher.rb:183:in
run'
/var/www/rails_api/shared/bundle/ruby/2.5.0/gems/puma-3.11.0/lib/puma/cli.rb:77:in run' /var/www/rails_api/shared/bundle/ruby/2.5.0/gems/puma-3.11.0/bin/puma:10:in
<top (required)>'
/var/www/rails_api/shared/bundle/ruby/2.5.0/bin/puma:23:in load' /var/www/rails_api/shared/bundle/ruby/2.5.0/bin/puma:23:in
<top (required)>'
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/07 09:05
2018/01/08 11:22