Skip to content

Commit 29b5daa

Browse files
committed
Fix devcontainer
Updates devcontainer base image Loosens the bin/setup ruby version check Adds some more logging
1 parent 1a504a2 commit 29b5daa

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Installs Ruby 3.2.2. When human-essentials moves to a newer version of ruby,
22
# it will be more efficient to change the image.
33
# See https://github.com/devcontainers/images/blob/main/src/ruby/history/
4-
FROM mcr.microsoft.com/devcontainers/ruby:dev-3.2-buster
4+
FROM mcr.microsoft.com/devcontainers/ruby:dev-3.2
55
RUN export DEBIAN_FRONTEND=noninteractive
66
RUN apt-get update && apt-get -y install vim curl gpg postgresql postgresql-contrib
77
RUN cd /tmp
88
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
9-
&& apt-get -y install ./google-chrome-stable_current_amd64.deb
9+
&& apt-get -y install ./google-chrome-stable_current_amd64.deb

.devcontainer/post-create.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
RUBY_VERSION="$(cat .ruby-version | tr -d '\n')"
22

33
# copy the file only if it doesn't already exist
4+
echo "*** Creating initial .env and vscode settings, if needed"
45
cp -n .devcontainer/.env.codespaces .env
56
mkdir -p .vscode && cp -n .devcontainer/launch.json.codespaces .vscode/launch.json
67

78
# If the project's required ruby version changes from 3.2.2, this command
89
# will download and compile the correct version, but it will take a long time.
910
if [ "$RUBY_VERSION" != "3.2.2" ]; then
11+
echo "*** Installing Ruby $RUBY_VERSION (this may take a while)"
1012
rvm install $RUBY_VERSION
1113
rvm use $RUBY_VERSION
1214
echo "Ruby $RUBY_VERSION installed"
1315
fi
1416

17+
echo "*** Setting up node"
1518
nvm install node
19+
20+
echo "*** Setting up ruby environment"
1621
rbenv init bash
1722
rbenv init zsh
1823

24+
# echo "*** Forcing platform version of nokogiri"
25+
# gem install nokogiri -v 1.18.1 --platform=ruby -- --use-system-libraries
26+
27+
echo "*** Running project bin/setup"
1928
bin/setup

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,4 +826,4 @@ DEPENDENCIES
826826
webmock (~> 3.24)
827827

828828
BUNDLED WITH
829-
2.6.2
829+
2.6.5

bin/setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ FileUtils.chdir APP_ROOT do
4040
#
4141
# Validate that the ruby version requirement is met.
4242
#
43-
expected_ruby_version = `cat .ruby-version`.chomp
43+
expected_ruby_version = `cat .ruby-version`.chomp.gsub(/\.\d+\z/, "")
4444
current_ruby_version = `ruby -v`.chomp
4545
unless current_ruby_version.include?(expected_ruby_version)
4646
log "Ruby version must be #{expected_ruby_version}. You are on #{current_ruby_version}", color: :red

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.2].define(version: 2025_02_21_143640) do
13+
ActiveRecord::Schema[7.2].define(version: 2025_03_02_154355) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "plpgsql"
1616

0 commit comments

Comments
 (0)