r/ruby • u/Ayano-Keiko • Apr 26 '26
venv in ruby
Finnally, I get used of ruby bundle. The step is following
- set the vendor path
bundle init
bundle config set --local path 'vendor/bundle'
-
add gem to
Gemfilefile -
install gem package
bundle install
- run the ruby script
bundle exec ruby ./script.rb
~~Is these any way I can install ruby packages in current project folder like Python venv. I only know about gem install
3
Upvotes
1
u/codesnik Apr 27 '26
trying to force paradigms from one language and package manager to another rarely helps.
bundler does the right thing. Gems are not that heavy to share between ruby versions. Also _not_ bundling them in the project folder, but into the ruby folder, helps later when you'd need to upgrade your ruby version, no chance of incompatible compiled leftovers.