Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #160
scripts/start_aaec.sh needs to use rbenv instead of rvm.
Scripts/start_aaec.sh doesn't actually call for the use of either rbenv or rvm. Here's the old version of the file:
Here's what ChatGPT had to say about the script:
Certainly, let's walk through the Bash script line by line to understand what it's doing:
#!/bin/bash
: This is the shebang line, telling the system that the script should be executed with thebash
shell.# Starts the application if it's not already running
: A comment line to describe what the script does.# Example usage: script/start-aaec.sh /opt/webapps/aaec /aaec production
: Another comment providing an example of how to run the script.APP_DIR=$1
: Sets the variableAPP_DIR
to the value of the first argument passed to the script. This is the directory where the app is installed.WEB_URI=$2
: SetsWEB_URI
to the second argument, which is the sub-URI where the app can be accessed.MODE=$3
: SetsMODE
to the third argument, which specifies whether the app is running in "production" or "development" mode.if ! ( [ -f $APP_DIR/tmp/puma/pid ] && pgrep -F $APP_DIR/tmp/puma/pid > /dev/null )
: This is anif
condition that checks if the Puma server (commonly used with Rails) is not running. It does so by checking if a PID file exists and if a process with that PID is running.then
: Starts the block of code to execute if theif
condition is true.cd $APP_DIR
: Changes the current directory to the app directory specified byAPP_DIR
.export PATH=$APP_DIR/vendor/bundle/ruby/3.2.2/bin:/usr/local/bin:$PATH
: Sets thePATH
environment variable to include the Ruby 3.2.2 bundled executables directory and other directories.export RAILS_ENV=$MODE
: Sets the Rails environment (RAILS_ENV
) to theMODE
specified (either "production" or "development").export RAILS_RELATIVE_URL_ROOT=$WEB_URI
: Sets the relative URL root for the Rails app.bin/bundle exec puma -d
: Runs Puma in daemon mode (-d
) using the bundled Ruby.fi
: Ends theif
block.This script doesn't specifically use RVM or rbenv. The Ruby version and dependencies are set using the
PATH
environment variable, which is set to look at the Ruby executable in thevendor/bundle/ruby/3.2.2/bin
directory....
The line export PATH=$APP_DIR/vendor/bundle/ruby/3.2.2/bin:/usr/local/bin:$PATH is more indicative of a "bundled" Ruby setup, potentially used in deployment environments to isolate dependencies. This is often seen in environments where you bundle Ruby and its gems together with your application code, such as in certain Docker or Capistrano setups.
In summary, the setting of the PATH in the script doesn't align well with how rbenv or RVM usually manage Ruby versions, and it's more indicative of a setup where the Ruby version and gems are bundled directly with the application.
SO!!!
I have not modified the scripts/start-aaec.sh file. I DID notice, however, that the scripts/start-local.sh file was expecting the user to be using rvm. Since it's possible that our developers might be using RVM and it shouldn't really matter for the sake of development, I updated the start-local.sh script to try to start the app with either rbenv or rvm versions, and to attempt to install a missing Ruby version 3.2.2 if asked.