diff --git a/README.md b/README.md index 06c0a6d5b..0c0ac1de9 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ Before you start, you will need to have Docker installed and running. You can [d Run `bin/dup` to build and create the docker container. This will also set up the Rails application within the container and start the container. You will only have to run this command once. After initial setup, use `bin/dstart` to start an existing container - using `bin/dup` will recreate an existing container and reset the database. +**Note:** The Docker setup includes ImageMagick automatically. If you're using native installation, you must install ImageMagick separately (see [native-installation-instructions.md](./native-installation-instructions.md)). + ### 4. Start the app Run `bin/dserver` to start the Rails server. diff --git a/db/seeds.rb b/db/seeds.rb index adc65b06f..d0bd05459 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,4 +1,25 @@ if Rails.env.development? + # Check for ImageMagick before seeding + imagemagick_available = system('convert --version > /dev/null 2>&1') || + system('magick --version > /dev/null 2>&1') + + unless imagemagick_available + Rails.logger.error "=" * 80 + Rails.logger.error "ERROR: ImageMagick is required to run db:seed" + Rails.logger.error "=" * 80 + Rails.logger.error "" + Rails.logger.error "The seed task processes sponsor logo images, which requires ImageMagick." + Rails.logger.error "" + Rails.logger.error "Install ImageMagick:" + Rails.logger.error " macOS: brew install imagemagick" + Rails.logger.error " Ubuntu/Debian: apt-get install imagemagick" + Rails.logger.error " Windows: https://imagemagick.org/script/download.php" + Rails.logger.error "" + Rails.logger.error "See native-installation-instructions.md for details." + Rails.logger.error "=" * 80 + exit 1 + end + begin Rails.logger.info 'Running migrations...' Rails.application.config.log_level = :info diff --git a/native-installation-instructions.md b/native-installation-instructions.md index 2112065b1..c876a778d 100644 --- a/native-installation-instructions.md +++ b/native-installation-instructions.md @@ -47,7 +47,7 @@ brew install postgresql brew services start postgresql ``` -Install other dependencies: +Install required dependencies: ``` brew install imagemagick ```