Composer not picking up asdf's ruby version

Hey all, I’m starting a Rails app running on Ruby 3.3.5 which I installed using asdf. This setup works fine in a terminal window, even in Cursor’s terminal.

When I ask composer to run ruby --version it prints 2.6 as the version (which is the version native to MacOS).

It seems like composer doesn’t start a bash shell and as such doesn’t run the .bashrc lines added by asdf.

Any suggestions on forcing Cursor to correctly pick up the right Ruby version based on the .tools-version file or at least correctly load a bash shell when running its commands?

Thanks in advance.

Hey, I think this is happening because Cursor doesn’t recognize your default terminal. Try selecting the terminal you need in the settings. More information can be found here:

If this doesn’t help, let me know, and I’ll try to look into it further.

@deanrie

I had the same issue. I am using zsh, and had a line like

export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"

in the bottom of my .zshrc that would put asdf in the front of the path for login shells. However, cursor’s composer was seeing a bunch of other stuff in the front of the path, including /usr/bin, which forced it to pick up system default ruby (I imagine this a problem for most other tools that might have a system default installed).

I found a solution which worked: add that same line into a .zshenv file, which I didn’t even have previously, but which Cursor seems to pickup. Now Cursor Composer sees the asdf shims at the front of the path.

1 Like