Capistranoでのデプロイについてご質問です。
https://qiita.com/d0ne1s/items/2dd0ec73db1b0f473509#puma%E3%82%92%E8%B5%B7%E5%8B%95
上記を参考に、ローカルのファイル一式をサーバー(さくらのVPS,CentOS7)にデプロイしようと、「bundle exec cap production deploy」を叩いたところです。
参考記事でいうと「pumaを起動」の前です。
そのときのGemfileはこんな感じです。
source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } リスト ruby '3.2.2' リスト # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.3' # Use mysql as the database for Active Record リスト # Use Puma as the app server gem 'puma', '~> 4.1' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem 'webpacker', '~> 4.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password # gem 'bcrypt', '~> 3.1.7' リスト # Use Active Storage variant # gem 'image_processing', '~> 1.2' リスト # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.4.2', require: false リスト group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '~> 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end リスト group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end リスト # Windows does not include zoneinfo files, so bundle the tzinfo-data gem リスト リスト gem 'capistrano', '~> 3.14' gem 'capistrano-rbenv' gem 'capistrano-rails', '1.6.0' gem 'capistrano-puma', '0.2.3', require: false
デプロイされているかをサーバー内で確認したところ、
ls -l drwxrwxr-x 12 harumaki harumaki 4096 Nov 19 01:26 20231118162617
一見問題なさそうなのですが、Gemfileの中身を見ると少し違うのです。。。
(おそらく、過去に編集していた内容が反映されているのだと思います)
source "https://rubygems.org" ruby "3.2.2" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.1.0" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" # Use sqlite3 as the database for Active Record gem "sqlite3", "~> 1.4" # Use the Puma web server [https://github.com/puma/puma] gem "puma", ">= 5.0" # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] gem "importmap-rails" # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] gem "turbo-rails" # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] gem "stimulus-rails" # Build JSON APIs with ease [https://github.com/rails/jbuilder] gem "jbuilder" # Use Redis adapter to run Action Cable in production # gem "redis", ">= 4.0.1" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] # gem "bcrypt", "~> 3.1.7" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ windows jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri windows ] end group :development do # Use console on exceptions pages [https://github.com/rails/web-console] gem "web-console" # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] # gem "rack-mini-profiler" # Speed up commands on slow machines / big apps [https://github.com/rails/spring] # gem "spring" end group :test do # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] gem "capybara" gem "selenium-webdriver" end
これはどのようにすれば最新のもの(ローカルの最新ファイル)をデプロイできるようになるのでしょうか。
修正して「bundle install」をしてみたり、Gemfile.lockを一回消してみたりしましたが、初心者のため分からず。。。
お手数をおかけしますが、解決方法をご教示いただけますと幸いです。
よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。