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

Fix 'required_ruby_version: unbound variable' #1373

Conversation

vsppedro
Copy link
Collaborator

@vsppedro vsppedro commented Nov 4, 2020

Running .bin/setup on ruby 2.7.2 was returning:

./bin/setup: line 240: required_ruby_version: unbound variable
./bin/setup: line 241: required_ruby_version: unbound variable

This PR solves this problem, but please test it locally. Thank you.

PS: If you take a look at the bin/setup file, you will notice that in some places the variable name is $REQUIRED_RUBY_VERSION and in others, it is $required_ruby_version.

Which one do you prefer?

@vsppedro vsppedro changed the title Fix unbound variable required_ruby_version Fix 'required_ruby_version: unbound variable' Nov 4, 2020
@vsppedro vsppedro force-pushed the fix/unbound-variable-required-ruby-version branch from 0ab9fdf to 9faae24 Compare November 4, 2020 23:20
@mcmire
Copy link
Collaborator

mcmire commented Nov 8, 2020

@vsppedro Yes, this seems to work for me. I would prefer REQUIRED_RUBY_VERSION (I think my original intent was that this would be a sort of global) so your change is fine with me.

By the way, this script is generated via my setup_script_generator gem. Instead of making changes directly to the script like this, it might be better to regenerate the script using the gem, otherwise a future update might blow away those changes. I've actually removed the rvm section entirely in the latest update since I don't use RVM myself and haven't run across anyone (yet) who uses it, so this problem would go away with that (or, if you do want to use it, I could add that section back). The latest update also contains a fix for installing Bundler 1.x — it seems that that the gem install GEM -v VERSION syntax has been replaced with gem install GEM:VERSION.

With that in mind, what do you think about running:

gem install setup_script_generator
generate-setup bin/setup --provision ruby

@vsppedro vsppedro force-pushed the fix/unbound-variable-required-ruby-version branch from 9faae24 to 0add19a Compare November 8, 2020 14:14
@vsppedro
Copy link
Collaborator Author

vsppedro commented Nov 8, 2020

Whops, I did notice this comment: DON'T MODIFY ANYTHING BELOW THIS LINE!. My bad! 😅

I use RVM, but you don't need to add that section for me. When I need it I will install ruby ​​manually, no problem.

With that in mind, what do you think about running:

gem install setup_script_generator
generate-setup bin/setup --provision ruby

Done!

Copy link
Collaborator

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vsppedro Oh sorry! If you use RVM I am happy to add that section (or a similar section) back to setup_script_generator. I just had no way of testing it myself so I couldn't know if it worked or not so that's why it was deleted.

In any case, I just tested bin/setup on this branch on my computer and it seems to work, so this looks good to me 👍

@vsppedro vsppedro merged commit 3adbbf1 into thoughtbot:master Dec 2, 2020
@vsppedro vsppedro deleted the fix/unbound-variable-required-ruby-version branch December 2, 2020 01:35
@vsppedro
Copy link
Collaborator Author

vsppedro commented Dec 2, 2020

No problem, @mcmire! It's not necessary. Thanks! Merging!

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

Successfully merging this pull request may close these issues.

None yet

2 participants