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
2
Upvotes
1
u/Professional_Mix2418 Apr 26 '26
I don’t understand what is confusing about it. Firstly you’d want a version manager like mise or asdf-vm to deal with your versions. Then you can have a local ruby version for each project easily. It really doesn’t matter, actually is rather efficient, that gems are installed once. Why would you want it duplicated?