Closed JoshDevHub closed 1 year ago
This has occurred to me before too, I do think it should be changed one way or the other. My instinct is that we should prefer doing it globally, because there is essentially zero content about bundler before doing the exercises. Makes it very easy for people to make mistakes because they don't have much context about the commands they're using.
Let me think about it a bit / raise it with the team, also happy to hear any other thoughts or ideas you have on the subject. Maybe there's room for some broader improvements in this area
Yeah I think I agree re: having learners go ahead and globally install rspec. I guess one other consideration with keeping bundler is that the curriculum may eventually move on from pry altogether in support of the debug gem, and this would be one more (admittedly small) thing to update should that happen.
I'm a little late to the party, but I think we should make this change (step 1 and 2 above). As far as the idea of moving away from pry, I don't see us eliminating it for the foreseeable future because many rails apps still rely on debugging with these tools. @JoshDevHub are you still willing to make these changes, or should we open this up to others?
Pry vs Debug probably needs more discussion (debug would be my own preference) but I think we agree that the bundler issue needs to be solved, so lets go ahead with changing this to use rspec globally.
@JoshDevHub I'll open this to public submissions but you're free to take it if you're still interested
@ChargrilledChook Yeah I'll be glad to take it. I don't know how I missed rlmoser's ping back in September :man_facepalming:
@JoshDevHub No worries mate, I've assigned this one to you 👌
Currently, the instructions for these exercises want users to install rspec from the Gemfile using
bundle install
and then from there, run tests usingbundle exec rspec path_to/file_spec.rb
. This works fine up until users start the debugging content, where the user cannot access their global install ofpry-byebug
while running commands prefixed withbundle exec
-- leading torequire
bugs that learners at this stage have a difficult time figuring out. Here's an example from the discord server today, but it has happened multiple times since the debugging exercises were introduced.I think there are two good ways to approach fixing the problem:
bundle exec
entirely.pry-byebug
in the Gemfile. It will then be installed in the users' local repo when they initially runbundle install
, which will eliminaterequire
errors when usingbundle exec
.Would be glad to submit a PR for whichever method is preferable. Also definitely open to other ideas if there are other ways to make this work more smoothly.