Skip to content

Commit 15a5e78

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 15a5e78

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

example_app_generator/generate_app.rb

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

36+
if Rails::VERSION::STRING ~= /^4\./
37+
append_to_file('Gemfile', "gem 'thor', '< 1.0'\n")
38+
end
39+
3640
if Rails::VERSION::STRING >= '6'
3741
gsub_file "Gemfile", /.*gem..sqlite3.*/, "gem 'sqlite3', '~> 1.4'"
3842
gsub_file "Gemfile", /.*rails-controller-testing.*/, "gem 'rails-controller-testing', git: 'https://github.com/rails/rails-controller-testing'"

0 commit comments

Comments
 (0)