By default, all Ruby REPLs run with the command ruby main.rb. This makes it impossible to run Ruby files with the context of Bundled Gems without explicitly setting run="bundler exec ruby main.rb" in the .replit file or running it in the Shell.
I don't know how package management works for Repl.it exactly, but this seems like some kind of oversight. If you were to do the standard gem installation method (i.e open the Interactive Package Manager in the IDE and search/add your gem) and then run your main Ruby file, any gems you might've installed straight up don't get included. The method described in the Repl.it blog (here) is also outdated and doesn't work either.
The most consistent fix I could come up with is bundler exec ruby main.rb, which allows the main Ruby file to be run with the context of gems you installed with bundle.
I'd love to open a PR and work on this if you guys are open to that. :P
By default, all Ruby REPLs run with the command
ruby main.rb
. This makes it impossible to run Ruby files with the context of Bundled Gems without explicitly settingrun="bundler exec ruby main.rb"
in the.replit
file or running it in the Shell.I don't know how package management works for Repl.it exactly, but this seems like some kind of oversight. If you were to do the standard gem installation method (i.e open the Interactive Package Manager in the IDE and search/add your gem) and then run your main Ruby file, any gems you might've installed straight up don't get included. The method described in the Repl.it blog (here) is also outdated and doesn't work either.
The most consistent fix I could come up with is
bundler exec ruby main.rb
, which allows the main Ruby file to be run with the context of gems you installed withbundle
.I'd love to open a PR and work on this if you guys are open to that. :P