# Fast lane and ruby versions

**URL:** <https://forum.buildkite.community/t/fast-lane-and-ruby-versions/1624>\
**Category:** General\
**Created:** [July 6, 2021, 3:13am UTC](https://forum.buildkite.community/t/fast-lane-and-ruby-versions/1624 "2021-07-06T03:13:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![priju\_paul](https://avatars.discourse-cdn.com/v4/letter/p/839c29/32.png) [@priju\_paul](https://forum.buildkite.community/u/priju_paul)\
**Post date:** [July 6, 2021, 3:13am UTC](https://forum.buildkite.community/t/fast-lane-and-ruby-versions/1624/1 "2021-07-06T03:13:21Z")

</div>

Hi,

I’m trying to build my android project using fastlane and buildkite. As my build machine is running on Mac OS Mojave, I have installed rbenv and have set the ruby version to 2.7.3. On terminal when i check the ruby version it shows 2.7.3 and appears like its all good.

I was also able to run the fastlane build locally in the build machine.

However, when i run the same command via buildkite, it stops at the error

“commander-4.6.0 requires ruby version \>= 2.4, which is incompatible with the current version , ruby 2.3.7”

How do i get buildkite to pick the ruby version set in in ./bash\_profile?

Thanks,

---

<div class="post-metadata">

**Author:** ![sj26](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/sj26/32/17_2.png) [@sj26](https://forum.buildkite.community/u/sj26)\
**Post date:** [July 6, 2021, 3:21am UTC](https://forum.buildkite.community/t/fast-lane-and-ruby-versions/1624/2 "2021-07-06T03:21:13Z")

</div>

Hi there!

It depends on how you’ve configured things a little bit.

Are you running your Buildkite Agent as a different user - might they have a different bash profile?

Have you placed the rbenv configuration in a file which will be sourced by bash for a non-interactive session? Bash will behave slightly differently when you open a terminal versus when it is run by another process. I think bash\_profile is only run for interactive login sessions. Could you try adding the rbenv configuration to your bashrc as well / instead?

For some context:

> <https://apple.stackexchange.com/questions/51036/what-is-the-difference-between-bash-profile-and-bashrc>

---

<div class="post-metadata">

**Author:** ![priju\_paul](https://avatars.discourse-cdn.com/v4/letter/p/839c29/32.png) [@priju\_paul](https://forum.buildkite.community/u/priju_paul)\
**Post date:** [July 6, 2021, 5:24am UTC](https://forum.buildkite.community/t/fast-lane-and-ruby-versions/1624/3 "2021-07-06T05:24:50Z")

</div>

Thanks for your response. I set command on ~/.bashrc, however that didnt help.

```auto
if which rbenv > /dev/null; then evan "$(rbenv init -)"; fi

```

What you mentioned makes sense, just dont know how to get buildkite pick the right ruby version.

---

<div class="post-metadata">

**Author:** ![sj26](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/sj26/32/17_2.png) [@sj26](https://forum.buildkite.community/u/sj26)\
**Post date:** [July 6, 2021, 5:39am UTC](https://forum.buildkite.community/t/fast-lane-and-ruby-versions/1624/4 "2021-07-06T05:39:04Z")

</div>

Maybe add some more diagnostic output, while you’re figuring it out?

```auto
# in bashrc
echo "--- Setting up rbenv"
if which rbenv > /dev/null; then
  echo "Found rbenv at $(which rbenv), configuring"
  eval "$(rbenv init -)"

  echo "Ruby versions available:"
  rbenv versions
else
  echo "Couldn't find rbenv! Is your PATH right?"
  echo "${PATH}"
fi

```

It’s common to install rbenv with homebrew. It might be installed into a homebrew location which isn’t on the default path. Homebrew users usually also put the homebrew path into $PATH using bash\_profile. So many sure you’re setting up your PATH in bashrc as well, if you need.
