How do I replace the Heroku gem with Heroku Toolbelt? - heroku

I know that there are closely related question to mine but they did not help me.
I'm learning the whole rails, gem, git, heroku concept and liking it a lot.
When I issued heroku command line actions (Ubuntu linux) I received warnings that the gem was deprecated and I should install the toolbelt.
I ran the full wget install of the tool belt:
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
But now when I use the heroku command line I still get the deprecated warning.
I suspect I have to get rid of the heroku gem but I'm not sure how to do that ? I want to be sure to do it correctly so it's not later loaded again via bundler.
Thank you.

The uninstall command will remove any gem. In this case, you want to use the following:
gem uninstall heroku

I had issues getting Toolbelt to work. I am running OSX so my solution may not work for your Ubuntu linux setup. I still thought I might share just in case. Here are the steps I used to get it to work:
Remove the heroku gem by running gem uninstall heroku. It did ask if I wanted to remove executables: heroku. Be sure to choose yes.
Go to [https://toolbelt.heroku.com/][1] and download / install the Toolbelt app.
On the Toolbelt page it mentioned that /usr/local/heroku/bin will be added to your PATH. I was not seeing this and was not sure if it is becuase I am running zsh instead of bash. I went ahead and opened my .zshrc file and added it to my PATH.

You probably just need to relaunch your shell.

This worked for me: (be sure to choose yes when it ask if you want to remove executable: heroku)
gem uninstall heroku --all
Source (last comment): http://johntwang.com/blog/2011/09/13/remove-heroku-toolkit/

Related

Error when using overcommit and Github Desktop

I am using overcommit gem (https://github.com/brigade/overcommit) in my project, when I use Github Desktop for osx I get these errors:
This repository contains hooks installed by Overcommit, but the
overcommit gem is not installed. Install it with gem install
overcommit. (1)
The gem is installed, it works in terminal. I guess it's because I use rvm and Github Desktop doesn't know about rvm. Anybody knows how to fix this?
Ok finally got it to work!
Combined the answer from #michelegera with comment from #rewritten
Step 1:
sudo su -
gem install bundler
gem install overcommit
gem install rubocop
Step 2: added command: ['bundle', 'exec', 'rubocop'] to .overcommit.yml
Thanks for the help!
Most likely it's this line where the error occurs. As you can see the main issue is that it's not able to require 'overcommit'. I don't know the GitHub desktop client so well (maybe there is a way to configure it inside of it), but one thing you could do is adding the absolute path where rvm stores your gems to the "require path" in the hook file. This could look like:
$: << "/home/user/.rvm/path/to/gems/dir"
The disadvantage of this is that you would have your absolute path in the hook file and it most likely won't work for others. You might also want to consider installing the gem globally for the the ruby interpreter that executes the script (see Shebang line in the hook file).
You are right, Github Desktop (or any other GUI) isn’t running in your terminal environment, so it knows nothing about your specific RVM installation.
A simple solution is to install overcommit and any other gems required by your hooks into your system Ruby:
sudo su -
gem install bundler
gem install overcommit
gem install rubocop
...
If you installed Git via Homebrew or other means, you might have to change the Git binary used by your GUI.
For example, in Tower, I selected Homebrew’s version rather than the System’s.

Changing Heroku version from gem to toolbelt

I have downloaded the Heroku toolbelt a few times but whenever I run
heroku version
I am getting
heroku-gem/1.6.3
I have tried to uninstall the heroku gem but I can't seem to use the heroku toolbelt. What's the correct process to use the toolbelt?
Thanks!
it's likely coming from a Gemfile that is including the heroku gem. Remove it from there.
Alternatively you could include the toolbelt higher in the PATH environment variable than your ruby gems.
I was having the same problem, this what I did:
Install the heroku-toolbelt from the webpage.
go to /usr/local/heroku/bin and run ./heroku version this will throw the version of the current bin, problably this is the version you want to use.
run which heroku this will throw you a path, if the path is diferent that /usr/local/heroku/bin then just: rm -rf path
restart your console/terminal run heroku version
if dosn't work probably you need to add /usr/local/heroku/ to your $PATH.
restart and thats all
I was using oh-my-zshell with the heroku plugin which gave me the error and this is how i solve it, hope work for you.
#UPDATE
I restart and suddenly I had the same error again :/ and I fixed by:
gem uninstall heroku and rbenv rehash

Command Not Found Jekyll

I'm trying to create and publish a Jekyll blog using this template.
I installed Jekyll initially. Without any luck, I did resort to installing it via sudo. (And have now since uninstalled it!)
Jekyll(1.4.2, 1.0.3) and am running rvm with ruby 2.0.0p195. After installing the gem, I run jekyll serve in the folder but get the error: Zsh Command Not Found. I tried changing my path to no avail. Any advice on how to troubleshoot?
I cannot uninstall/reinstall nokogiri (see other SO articles on this) because of dependencies related to work projects.
If you're using rvm you should not install gems with sudo. Rvm is user-specific (the binaries are all in your home directory), so putting Ruby stuff in system-wide folders with sudo will not work. Just install without sudo and you should be ok.
The rvm docs tries to explain this a little bit here:
http://rvm.io/rubies/rubygems
DO NOT use sudo...
...to work with RVM gems. When you do sudo you are running commands as root, another user in another shell and hence all of the setup that RVM has done for you is ignored while the command runs under sudo (such things as GEM_HOME, etc...). So to reiterate, as soon as you 'sudo' you are running as the root system user which will clear out your environment as well as any files it creates are not able to be modified by your user and will result in strange things happening. (You will start to think that someone has a voodoo doll of your application...)

gem command not found through git bash

I'm new to git and I've been setting up a jekyll blog through my github account. I'm using the git bash command line. In the instructions one of the commands is:
$ gem install jekyll
When I run this it tells me:
sh.exe": gem: command not found
Anyone know how I can fix this? Does this have anything to do with Ruby?
gem, RubyGems, is a package manager for Ruby. It seems that it is not installed on your computer, or not available inside your $PATH.
First, try to execute which gem to see whether you can access it or not. Then,
If you previously installed gem, you probably have to modify $PATH to add the package manager's executable location.
If you did not, you need to. On Windows, your best option is to install Cygwin.

Installing heroku client only, and not the other things

I am using RVM for my Ruby installations.
I recently encountered a problem installing the heroku toolbelt with it installing Ruby 1.9.1 on my actual system, which then rewriting environment variables, and breaking my ruby cli. I had to delete everything, reinstall RVM, reinstall gems, ect ect..
The point is, I wish to be able to use the heroku client, and possibly foreman, but I don't want the toolbelt trying to install git, and ruby 1.9.1 on my system.
I tried to do the gem install version, but it states that the gem is depreciated, and for me to install the toolbelt.
Any help will be greatly appreciated.
Thank you for all thoughtful answers.
Go to the Heroku CLI on github and download the tarball from the other setup. Extract the Tarball and move the resulting files under /usr/local/heroku. Add /usr/local/heroku/bin to your PATH. Ensure that Heroku gem is removed from any project gem files. Reload your terminal and the Heroku CLI should be working.
You can run which heroku from your project directory and you should get /usr/local/heroku/bin/heroku.
As it is self updating you should only need to do this once.
If you want Foreman just use the Gem version.
Git and Ruby will not be installed using this process.
Update: Heroku now have an install script for a standalone install of the Heroku Client without Foreman and Git.
On Windows, the Heroku Toolbelt installer offers a choice between Full Installation and Custom Installation. If you choose Custom, you can select which components you want to install.

Resources