Skip to content

Commit 5234861

Browse files
committed
Avoid rails app generation error when using last Thor
The last Thor version break `rails generate controller` command. Related: - rails/rails#37978
1 parent 7a03e4f commit 5234861

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

example_app_generator/generate_app.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
append_to_file('Gemfile', "gem 'rails-controller-testing'\n")
3434
end
3535

36+
# ToDo: Remove when not supporting Rails 4.2 anymore
37+
if Rails::VERSION::STRING ~= /^4\./
38+
append_to_file('Gemfile', "gem 'thor', '< 1.0'\n")
39+
end
40+
3641
if Rails::VERSION::STRING >= '6'
3742
gsub_file "Gemfile", /.*gem..sqlite3.*/, "gem 'sqlite3', '~> 1.4'"
3843
gsub_file "Gemfile", /.*rails-controller-testing.*/, "gem 'rails-controller-testing', git: 'https://github.com/rails/rails-controller-testing'"

0 commit comments

Comments
 (0)