How do I add a package to a Ruby repl?
I am unable to get packages installed in a Ruby repl.
Here are the reproduction steps:
- Click on 'new repl'
- Choose 'Ruby' for the language
- Click 'Create Repl'
- On the left, click on the package icon
- Add a package. In my example, I added 'bcrypt'
- Note that the package appears to be installed correctly, and shows up in
- Try to use the gem. Write some code that uses it, click 'run', and fail.
Taking a look at my example repo, you can see I
require "bcrypt" and this fails if I run the code. I get "cannot load such file -- bcrypt". If instead, I type
bundle exec ruby main.rb, the gem is loaded successfully. However, there seems to be no way to make this workaround 'stick' to the run button.