Sourcetree use alterative ruby

Hi, is it possible to use an alternative ruby version within sourcetree?

I need it, to use the newest version of lolcommits

Sourcetree always tries to use the system ruby Version 1.8

instead of my newly installed ruby version 1.9.3 (works fine in terminal)

here my git commit output from sourcetree:

git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F /var/folders/yz/6ngr49dd0fv22kphv_yq_47m0000gn/T/SourceTreeTemp.bxFaJm 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem lolcommits (>= 0) (Gem::LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
	from /usr/bin/lolcommits:18
Completed successfully

2 answers

1 accepted

0 votes
Accepted answer

thanks for the hint, but editing /etc/paths and /etc/launchd.conf doesn't take effect on Mountain Lion!

Apple's Developer Forums say this:

Change the Info.plist of the .app itself to contain an "LSEnvironment" dictionary with the environment variables you want.

~/.MacOSX/environment.plist is no longer supported.

So I edit SourceTree's Info.plist (right click on "" and then "Show package contents") and added a new key/dict pair called:



now my SourceTree App uses git 1.9.3 :-)



RVM is a good way to make Ruby versions co-exist cleanly, but if you don't want to do that, you'll need to make sure that all Mac apps use the new version rather than just the terminal. You've probably updated your PATH to point to the new Ruby, but this has no effect on Mac apps because they're launched by a process called 'launchd' whose environment is entirely separate from the terminal.

To update the path across the board for Mac apps too, you need to update /etc/paths and reboot. Hopefully that will solve your problem.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,125 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you