The Linux version of this is horribly wrong in so many ways. For one, you're downloading a shell script and running it with root privileges. A shell script that loads someone else's key into your system's database of trusted package signing keys, and then installs a package that can do just about anything to your system, including `rm -rf /*`.
And beyond the immediate security issues, this tramples both on the system git packages (because I doubt that Heroku uses so many advanced git features that they need the latest version) and on however you or your distro use RubyGems. Really, it would be far better to link to a page that tells you:
sudo apt-get install git-core rubygems
sudo gem install heroku foreman