$ sudo su - # ls -l /proc/1797/ 合計 0 dr-xr-xr-x 2 user user 0 7月 31 00:47 2020 attr -rw-r--r-- 1 user user 0 7月 31 00:47 2020 autogroup -r-------- 1 user user 0 7月 31 00:47 2020 auxv -r--r--r-- 1 user user 0 7月 31 00:47 2020 cgroup --w------- 1 user user 0 7月 31 00:47 2020 clear_refs -r--r--r-- 1 user user 0 7月 31 00:46 2020 cmdline -rw-r--r-- 1 user user 0 7月 31 00:47 2020 comm -rw-r--r-- 1 user user 0 7月 31 00:47 2020 coredump_filter -r--r--r-- 1 user user 0 7月 31 00:47 2020 cpuset lrwxrwxrwx 1 user user 0 7月 31 00:47 2020 cwd -> /var/www/user-cms/releases/20200729065345 -r-------- 1 user user 0 7月 31 00:47 2020 environ lrwxrwxrwx 1 user user 0 7月 31 00:47 2020 exe -> /usr/local/rbenv/versions/2.4.10/bin/ruby dr-x------ 2 user user 0 7月 31 00:47 2020 fd dr-x------ 2 user user 0 7月 31 00:47 2020 fdinfo -r-------- 1 user user 0 7月 31 00:47 2020 io -rw------- 1 user user 0 7月 31 00:47 2020 limits -rw-r--r-- 1 user user 0 7月 31 00:47 2020 loginuid -r--r--r-- 1 user user 0 7月 31 00:47 2020 maps -rw------- 1 user user 0 7月 31 00:47 2020 mem -r--r--r-- 1 user user 0 7月 31 00:47 2020 mountinfo -r--r--r-- 1 user user 0 7月 31 00:47 2020 mounts -r-------- 1 user user 0 7月 31 00:47 2020 mountstats dr-xr-xr-x 6 user user 0 7月 31 00:47 2020 net dr-x--x--x 2 user user 0 7月 31 00:47 2020 ns -r--r--r-- 1 user user 0 7月 31 00:47 2020 numa_maps -rw-r--r-- 1 user user 0 7月 31 00:47 2020 oom_adj -r--r--r-- 1 user user 0 7月 31 00:47 2020 oom_score -rw-r--r-- 1 user user 0 7月 31 00:47 2020 oom_score_adj -r--r--r-- 1 user user 0 7月 31 00:47 2020 pagemap -r--r--r-- 1 user user 0 7月 31 00:47 2020 personality lrwxrwxrwx 1 user user 0 7月 31 00:47 2020 root -> / -rw-r--r-- 1 user user 0 7月 31 00:47 2020 sched -r--r--r-- 1 user user 0 7月 31 00:47 2020 schedstat -r--r--r-- 1 user user 0 7月 31 00:47 2020 sessionid -r--r--r-- 1 user user 0 7月 31 00:47 2020 smaps -r--r--r-- 1 user user 0 7月 31 00:47 2020 stack -r--r--r-- 1 user user 0 7月 31 00:46 2020 stat -r--r--r-- 1 user user 0 7月 31 00:47 2020 statm -r--r--r-- 1 user user 0 7月 30 22:38 2020 status -r--r--r-- 1 user user 0 7月 31 00:47 2020 syscall dr-xr-xr-x 5 user user 0 7月 31 00:47 2020 task -r--r--r-- 1 user user 0 7月 31 00:47 2020 wchan
$ docker logs コンテナID /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: error: /etc/nginx/conf.d/default.conf is not a file or does not exist /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Configuration complete; ready for start up 2020/07/22 07:55:16 [emerg] 1#1: host not found in upstream "rails:3000" in /etc/nginx/conf.d/rails.conf:2 nginx: [emerg] host not found in upstream "rails:3000" in /etc/nginx/conf.d/rails.conf:2
$ docker volume ls DRIVER VOLUME NAME local 0d506af3b9c55280acce2e034fb7ff2b6f19c9c23192e6de91ac406702236f8d local 2f6589f1ec9c16dd1fcdc638aa2df316c3d1e5fa9c712651e8b61997ca26d0d1 local 3c8d4c4aa95221be36b5adc472549440e7330764ad3b8bef08f37d4d59f4d4ba ...
$ docker volume ls -f dangling=true DRIVER VOLUME NAME local 0d506af3b9c55280acce2e034fb7ff2b6f19c9c23192e6de91ac406702236f8d local 2f6589f1ec9c16dd1fcdc638aa2df316c3d1e5fa9c712651e8b61997ca26d0d1 local 3c8d4c4aa95221be36b5adc472549440e7330764ad3b8bef08f37d4d59f4d4ba ...
NOTE: This system is namespaced. The namespace you are currently in may not be the root. System services are namespaced; to access, use `ctr -n services.linuxkit ...` login[72826]: root login on 'ttyS0'
前回のRailsアプリケーションの作成ではRubyの現時点での最新版を指定しました。が、workflowでは初期値2.6を指定しており、一致しておらず、Your Ruby version is 2.6.6, but your Gemfile specified 2.7.1というエラーが出ます。ですので、workflowのRubyバージョン指定を2.7.1に変更します。
1 2 3 4 5 6 7
- uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0 with: ruby-version: 2.7.1 - name: Install dependencies run: bundle install
# This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
steps: - uses: actions/checkout@v2 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): # uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0 with: ruby-version: 2.7.1
- name: Setup Database env: RAILS_ENV: test run: | cp config/database.yml.ci config/database.yml ./bin/rails db:create ./bin/rails db:migrate - name: Run tests run: ./bin/rails test
Downloading ruby-2.7.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2 Installing ruby-2.7.1... ruby-build: using readline from homebrew Installed ruby-2.7.1 to /Users/username/.anyenv/envs/rbenv/versions/2.7.1
$ bundler init Writing new Gemfile to ~/github/github_actions_for_rails/Gemfile
Gemfileの更新
作成したGemfileを更新します。MySQLを利用する予定なのでmysql2を追加します。
1 2
gem 'rails' gem 'mysql2'
bundle install
bundle installします
1 2 3 4 5 6 7 8 9 10 11
Installing mysql2 0.5.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
(中略)
linking shared-object mysql2/mysql2.bundle ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [mysql2.bundle] Error 1
$ ./bin/rails s -b 0.0.0.0 => Booting Puma => Rails 6.0.3.2 application starting in development => Run `rails server --help` for more startup options Puma starting in single mode... * Version 4.3.5 (ruby 2.7.1-p83), codename: Mysterious Traveller * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://0.0.0.0:3000 Use Ctrl-C to stop
$ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 65b5af36d7ac centos:mariadb0001 "/mariadb.sh" 4 days ago Up 4 days 3306/tcp mariadb0001
$ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a4d1693a7981 centos:mw0001 "/sbin/init" 3 hours ago Up 3 hours mw0001 65b5af36d7ac centos:mariadb0001 "/mariadb.sh" 4 days ago Up 4 days 3306/tcp mariadb0001