-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: UseRubyVersion and pipeline still uses the system ruby #4506
Comments
Hi @djiangnz thank you for reporting! |
@djiangnz could you please check the Bundler path? |
@vmapetr sorry for my late reply.
the path of bundler is
I don't have bundle in |
Hi @djiangnz, thank you for your response! When you use the On the hosted machine, it looks like this:
Default Ruby:
After UseRubyVersion:
Here, on the hosted agents, the machine already has several pre-installed Ruby versions which also include the Bundler binary, and the task simply prepends the location of the selected Ruby version to the system path so when you execute However, while using the self-hosted environment, you need to prepare the required versions of Ruby and Bundler manually before executing the task. |
@vmapetr Thanks for your reply. I think I've identified the issue, and believe this is not an azure agent bug. Thanks for your help. TL;DR: Here is the output before adding bundler to the tool cache folder - bash: |
which ruby # /usr/bin/ruby
ruby --version # ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin22]
which bundle # /usr/local/bin/bundle
- task: UseRubyVersion@0
inputs:
versionSpec: '2.7.8' # Prepending PATH environment variable with directory: /Users/.../_work/_tool/Ruby/2.7.8/x64/bin
- bash: |
which ruby # /Users/.../_work/_tool/Ruby/2.7.8/x64/bin/ruby
ruby --version # ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-darwin22]
which bundle # /usr/local/bin/bundle After adding Bundler to the tool cache ....
- task: UseRubyVersion@0
...
- bash: |
which ruby # /Users/.../_work/_tool/Ruby/2.7.8/x64/bin/ruby
ruby --version # ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-darwin22]
which bundle # /Users/.../_work/_tool/Ruby/2.7.8/x64/bin/bundle |
@djiangnz Glad that I can help! |
What happened?
I expect that Ruby in the cache tool should always be used after UseRubyVersion.
/usr/bin/ruby
, bundler is/usr/local/bin/bundle
the PATH is updated
4. a job in a pipeline.yml is
- bash: "./ci/bundle_install"
5. in
./ci/bundle_install
echo "$(which ruby)" # /Users/***/_work/_tool/Ruby/2.7.8/x64/bin/ruby echo "$(ruby -v)" # ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-darwin22] bundle install --verbose
Versions
macOS: 13.6
Agent: 3.227.2
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
macos 13.6
Version controll system
No response
Relevant log output
The text was updated successfully, but these errors were encountered: