Skip to content

Commit 113ca9e

Browse files
authored
Merge pull request rails#51285 from tsvallender/ensure_image_processing_installed_trix
Ensure image_processing is installed with Trix
2 parents 087260d + 259b08b commit 113ca9e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

actiontext/lib/generators/action_text/install/install_generator.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ def create_actiontext_files
6262
def enable_image_processing_gem
6363
if (gemfile_path = Pathname(destination_root).join("Gemfile")).exist?
6464
say "Ensure image_processing gem has been enabled so image uploads will work (remember to bundle!)"
65-
uncomment_lines gemfile_path, /gem "image_processing"/
65+
image_processing_regex = /gem ["']image_processing["']/
66+
if File.readlines(gemfile_path).grep(image_processing_regex).any?
67+
uncomment_lines gemfile_path, image_processing_regex
68+
else
69+
run "bundle add --skip-install image_processing"
70+
end
6671
end
6772
end
6873

0 commit comments

Comments
 (0)