From b6b6864a3dec9160688d1502c751db867bc63fbb Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Tue, 19 Dec 2023 18:40:22 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Attempting=20fix=20of=20bin/rail?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the docker container, I'm unable to run `rails c`; I get an error regarding the hyrax application. This is an attempt to see if we can tidy that up. --- Dockerfile | 1 + bin/rails | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 325d61452..793acaf83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -82,6 +82,7 @@ RUN ln -sf /usr/lib/libmediainfo.so.0 /app/fits/tools/mediainfo/linux/libmediain ln -sf /usr/lib/libzen.so.0 /app/fits/tools/mediainfo/linux/libzen.so.0 COPY --chown=1001:101 ./bin/db-migrate-seed.sh /app/samvera/ +COPY --chown=1001:101 ./bin/rails /app/samvera/ ONBUILD ARG APP_PATH=. ONBUILD COPY --chown=1001:101 $APP_PATH/Gemfile* /app/samvera/hyrax-webapp/ diff --git a/bin/rails b/bin/rails index dd027b406..e00bc324f 100755 --- a/bin/rails +++ b/bin/rails @@ -1,5 +1,21 @@ #!/usr/bin/env ruby # frozen_string_literal: true -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' + +APP_PATH = File.expand_path("./hyrax-webapp/config/application", __dir__) + +# Set up gems listed in the Gemfile. +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("./hyrax-webapp/Gemfile", __dir__) +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "active_storage/engine" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "action_cable/engine" +# require "rails/test_unit/railtie" +require "rails/engine/commands"