Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If rails new fails, created files are not removed #1226

Open
louis-antonopoulos opened this issue Oct 8, 2024 · 1 comment
Open

If rails new fails, created files are not removed #1226

louis-antonopoulos opened this issue Oct 8, 2024 · 1 comment

Comments

@louis-antonopoulos
Copy link
Contributor

When running rails new, if an error is encountered, all the files that are created are not removed, including databases.

Related: can any known requirements (such as the Node version) be checked before starting?

rails new my-app-name \
 --skip_rubocop \
 --skip-test \
 -d=postgresql \
 -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb

Example error:

The template [https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb] could not be loaded. Error: 

=== Node version unsupported ===

Suspenders requires Node >= 20.0.0
@stevepolitodesign
Copy link
Contributor

Noting, this also applies to cases where the wrong arguments are not passed:

else
message = <<~ERROR
=== Please use the correct options ===
# Use the latest suspenders release:
rails new <app_name> \\
--skip-rubocop \\
--skip-test \\
-d=postgresql \\
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
# OR use the current (possibly unreleased) `main` branch of suspenders:
rails new <app_name> \\
--suspenders-main \\
--skip-rubocop \\
--skip-test \\
-d=postgresql \\
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
ERROR
fail Rails::Generators::Error, message
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants