Error installing Heroku Toolbelt - heroku

Tried to install Heroku Toolbelt but now I get a Gem:LoadError error when trying to issue any heroku command.
$ heroku -v
/Users/xyz/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in
`to_specs': Could not find heroku (>= 0) amongst [...]
(Gem::LoadError)
$ which heroku
/Users/xyz/.rvm/gems/ruby-1.9.3-p194#global/bin/heroku
It seems it's still seeking the gem, but I already uninstalled it. How can I fix this?
(OSX Mountain Lion)

I might be misunderstanding the issue, but if it is just that the heroku gem is not installed/missing try:
$ gem install heroku

I had the same issues initially with ROR on Windows/OS X.(Everyone suggested me to move to LINUX/UNIX)
Rather than installing the Heroku Toolbet (which breaks ruby and rails which is already installed) install the heroku gem along with foreman gem.
gem install heroku
gem install foreman
Then you can use it easily.

Related

Upgraded Heroku from gem to toolbelt, but still old version

Heroku recommends switching from the old gem to the new "Heroku Toolbelt":
https://blog.heroku.com/archives/2012/10/15/upgrading-to-the-heroku-toolbelt
I ran these commands successfully:
$ sudo gem uninstall heroku
$ sudo gem uninstall heroku --all
$ wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
Then I restarted my terminal, and... I still have the old version:
$ heroku version
heroku-gem/2.33.5 (x86_64-linux) ruby/1.9.3
$ heroku fork
! `fork` is not a heroku command.
$ which heroku
/home/me/.rvm/gems/ruby-1.9.3-p362/bin/heroku
What did I forget?
Similar questions:
How do I replace the Heroku gem with Heroku Toolbelt? but none of the answers work
Heroku toolbelt fails update and rails/heroku migrating from gem to toolbelt but I have no ~/.heroku/client folder
It looks like you still have the gem installed in one of your rvm installations.
Try removing the gem without sudo:
gem uninstall heroku
The value of which heroku should not be in the ~/.rvm folder, but /usr/local.

git push heroku master issue

I am having a problem with my application not being uploaded to heroku. When I typed in:
git push heroku master
I get an error at the end:
**Results logged to /tmp/build_2akv91a7tpdfl/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.3.7' succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app**
When i tried installing the gems its asking for, and redid the process the same error message comes up even after i installed 'gem install sqlite3 -v '1.3.7.''
(For those who are following Michael Hartl rails tutorials i followed it by detail but I'm still getting an error message.)
Any help will be greatly appreciated. I am new to rails so if you have a solution, please do speak in layman's terms.
I don't think you can use sqlite3 on Heroku. You can use postgres instead.
Remove sqlite3 gem and add pg gem in your Gemfile.
gem 'pg'
Since Heroku provides you a PostgreSQL database for your app, edit your Gemfile and change this line:
gem 'sqlite3'
To this:
gem 'pg'

heroku db:pull does not work?

I get the following error message:
heroku db:pull --debug postgres://USERNAME:PASSWORD#localhost/test
Loaded Taps v0.3.23
Warning: Data in the database 'postgres://USERNAME:PASSWORD#localhost/test' will be overwritten and will not be recoverable.
Receiving schema
Unable to fetch tables information from http://heroku:foo9dsfsdfsdb465ar#taps19.heroku.com. Please check the server log.
The command above does not produce any messages in the log that can be viewed using 'heroku logs'.
Any idea what I am doing wrong?
Use pgbackups instead of taps/db:pull
http://devcenter.heroku.com/articles/pgbackups
I answered to similar problem here:
Unable to fetch tables information when running heroku db:pull
I found some kind of work-around.
I have the same problem with my SHARED_DATABASE on heroku
ruby 1.9.2
gems:
pg (0.11.0)
heroku (2.32.4)
heroku-api (0.3.5)
taps (0.3.24)
heroku db:pull ended with:
Unable to fetch tables information from http://...#taps19.heroku.com. Please check the server log.
I switched to ruby 1.8.7 using rvm and heroku db:pull works fine.
Back again to ruby 1.9.2 to develop my application.
I hope this help someone until db:pull will be fixed with ruby 1.9.2.
Was able to get it going by reverting back to ruby 1.9.3 and Rails 3.1.0.
Here are some instructions on how to do that with rvm:
$ rvm install 1.9.3
$ ruby -v
$ rvm use 1.9.3-p286
$ rvm gemset create rails310
$ rvm 1.9.3-p286#rails310
$ rails -v
$ gem install rails -v 3.1.0
$ rvm gemset list
$ heroku db:pull –app <yourapp>
$ gem install taps
$ gem install sqlite3
$ heroku db:pull –app <yourapp>
More reading on rvm can be found here: http://rvm.io/gemsets/basics

Heroku and adding SSH keys (trouble installing heroku gem

I am new to programming and trying to understand this error. The error is really strange because I have already installed the heroku gem (using sudo and not using sudo). I am using OS X.
skline-mac:~ skline$ sudo heroku keys:add
/Users/skline/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb:861:in `report_activate_error': Could not find RubyGem heroku (>= 0) (Gem::LoadError)
from /Users/skline/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb:255:in `activate'
from /Users/skline/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb:1204:in `gem'
from /Users/skline/.rvm/gems/ruby-1.9.2-p136#rails3tutorial/bin/heroku:18:in `<main>'
You're using rvm, so there's no need for sudo, either for gem install heroku or using the heroku gem. This should work without any use of sudo:
gem install heroku
heroku keys:add
If this does not work, try resetting the ownership on your .rvm directory to your own user account (because you used sudo at some point in the past):
sudo chown -R $USER:staff ~/.rvm

Error running heroku console. can't update heroku

When I try to run heroku console I get the following error:
user#omnipresent:~/rails/demo$ heroku console
! This version of the heroku gem has been deprecated.
! Please update it by running: gem update heroku
When I do the update..it says there is nothing to update!
user#omnipresent:~/rails/demo$ gem update heroku
Updating installed gems
Nothing to update
Following are my versions:
user#omnipresent:~/rails/demo$ heroku version
heroku-gem/1.5.2
user#omnipresent:~/rails/demo$ ruby -v
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
user#omnipresent:~/rails/demo$ rails -v
Rails 2.3.5
running heroku list shows following:
user#omnipresent:/usr/bin$ gem list heroku
*** LOCAL GEMS ***
heroku (1.8.5, 1.8.3, 1.8.0, 1.5.2)
Even though I already had 1.8.5...I guess installing it again forces the class cache update.
user#omnipresent:~/rails/seconddemo$ sudo gem install heroku
Successfully installed heroku-1.8.5
1 gem installed
Installing ri documentation for heroku-1.8.5...
Updating class cache with 3098 classes...
Installing RDoc documentation for heroku-1.8.5...
user#omnipresent:~/rails/seconddemo$ heroku console
Ruby console for myapp.heroku.com
>>

Resources