Heroku trouble - uninstall/reinstall heroku toolbelt ubuntu

MandM picture MandM · Mar 4, 2013 · Viewed 8.5k times · Source

I'm running an Ubuntu instance on Amazon Web Services for development of a Ruby on Rails app (which is being used to test running the local rails server) and am pushing the app to Heroku for deployment.

This setup has worked for me without issues until yesterday when I wanted to push the contents of my development database to production rather than just the app itself. After some quick googling, this seemed to be easily accomplished by using Taps. I wasn't sure whether or not taps was preloaded with the Heroku Toolbelt (which is what I had been using), so after following the documentation on Heroku, I just ran the command rake db:push - this returned the error:

Taps Load Error: cannot load such file -- taps/operation
You may need to install or update the taps gem to use db commands.
On most systems this will be:

sudo gem install taps

Easy enough, right? Wrong. After running sudo gem install taps (and watching the installation run without any issue), I reran the command rake db:push just to find myself facing the same Taps Load Error. Considering how easily Heroku services had run before, this was a bit of a surprise that things didn't go swimmingly at the first shot.

After some more googling, I came upon an issue that was opened over two years ago on Heroku's github page that has received posts up until as recent as 3 months ago with people dealing with this issue, so after reading through a few testimonials I decided to try and go with the direct install of the heroku gem (even though it is being deprecated to be replaced entirely by the Toolbelt) as people were seemingly getting the right results.

I was hesitant because I didn't want to have the toolbelt and the standalone gem competing with one another, so I googled how to uninstall the heroku toolbelt (which doesn't seem to have a good heroku-provided solution - may open a ticket on heroku...), but I followed the directions on this link, which someone should smack me for because it was just the following commands:

rm -rf /usr/local/heroku
rm -rf /usr/bin/heroku

And these commands don't consider dependencies, etc... I think that is partially (if not completely) the root of my problem. At this point, I ran the command sudo gem install heroku, got the deprecation warning, and then simply tried to run the command heroku login as a litmus test to see if it had been installed correctly, but I received a beastly Gem:LoadError that said

Could not find heroku (>= 0) amongst [... a bunch of gems ...]

So, I decided I'd just try and go back to the beginning and not worry about things, so I uninstalled the heroku gem which was a simple sudo gem uninstall heroku, removed the associated executables, and then tried to reinstall the Toolbelt by following the command listed on Heroku:

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

After a bunch of positive-looking output was printed to the screen, I figured everything was going to be OK, but the last messages of the install process were:

heroku-toolbelt is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 102 not upgraded.

And this is where I am, I've removed the obviously-important contents by following the link (smack me again, please), and now installation of the toolbelt doesn't notice that they're missing and I'm stuck without heroku or taps! (Also, it's upsetting that heroku doesn't provide a clean way to uninstall the toolbelt - this would've made going about something like this much less complicated)

Help is greatly appreciated.

Answer

MandM picture MandM · Mar 4, 2013

Ugh - figured it out. After inspecting the shell script that is downloaded, I saw that it ends up running the command

sudo apt-get install heroku-toolbelt

So I ended up having to remove the heroku and heroku-toolbelt packages with apt-get by running

sudo apt-get --purge remove heroku
sudo apt-get --purge remove heroku-toolbelt

And then reinstalling the toolbelt with

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

And now everything seems to be playing nice again.