Heroku client internal error for pg command - heroku

When trying to run any of the heroku pg commands I'm getting this traceback:
$ heroku pg
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: undefined method `get_attachments' for #<Heroku::API:0x007ffcf08b0390> (NoMethodError)
Backtrace: /Users/erik/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:99:in `app_attachments'
/Users/erik/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:104:in `hpg_databases'
/Users/erik/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:62:in `all_databases'
/Users/erik/.heroku/client/lib/heroku/command/pg.rb:340:in `hpg_databases_with_info'
/Users/erik/.heroku/client/lib/heroku/command/pg.rb:19:in `index'
/Users/erik/.heroku/client/lib/heroku/command.rb:218:in `run'
/Users/erik/.heroku/client/lib/heroku/cli.rb:28:in `start'
/usr/bin/heroku:25:in `<main>'
Command: heroku pg
Plugins: heroku-config
heroku-pg-extras
Version: heroku-toolbelt/3.6.0 (universal.x86_64-darwin13) ruby/2.0.0
All other commands work -- and the pg commands worked find previously. Any thoughts on what might be the problem?

I just ran into the same exact issue and opened a Heroku support ticket. They suggested I actually download a whole new toolbelt .pkg from http://toolbelt.heroku.com and install that. I had just ran
heroku update
But that didn't solve the issue even though my toolbelt version was showing 3.6.0. I downloaded the new .pkg from the link above, ran it and everything worked perfectly.

Had to first uninstall the Heroku toolbelt:
rm -rf ~/.heroku
sudo rm -rf /usr/local/heroku /usr/bin/heroku
And then reinstall it. That solved the problem.

I had a similar issue, I resolved it by updating my Heroku Toolbelt as well as Postgres.app. I also made sure that my $PATH contained the correct location of the most recent Postgres.app installation per these instructions; however Postgres.app automatically adjusted the path location when starting to the most current location.
Hope that helps.

Related

Rails: Could not find concurrent-ruby-1.0.5 in any of the sources (Bundler::GemNotFound)

I've Googled this quite a bit, and haven't found anything useful to my situation.
$ docker-compose up abc
produces the following in the logs:
/usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:92:in `block in materialize': Could not find concurrent-ruby-1.0.5 in any of the sources (Bundler::GemNotFound)
from /usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:85:in `map!'
from /usr/lib/ruby/vendor_ruby/bundler/spec_set.rb:85:in `materialize'
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:132:in `specs'
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:177:in `specs_for'
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:166:in `requested_specs'
from /usr/lib/ruby/vendor_ruby/bundler/environment.rb:18:in `requested_specs'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:13:in `setup'
from /usr/lib/ruby/vendor_ruby/bundler.rb:121:in `setup'
from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:17:in `<top (required)>'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
The relevant bit from my docker-compose.yml file:
command: bundle exec rails server
concurrent-ruby is most definitely installed, exactly where it needs to be. I've run bundle install inside Docker so many times, and I've tried adding gem install concurrent-ruby -v 1.0.5 to my docker-compose command, and it installs just fine, and then still complains that it can't find the gem. I tried adding bundle install directly to my docker-compose command, and that fails because of some known issue involving docker-compose and git (I'm using two internal gems). [ EDIT: https://github.com/docker/compose/issues/2856#issuecomment-236625662 ]
Everything worked fine until I upgraded some Ruby gems, but I'm not sure why or how to fix it.
I had an issue similar to this outside of Docker.
I deleted the Gemfile.lock and ran bundle.
Issue went away.
Your mileage may vary.
I had this same error with docker-compose. Apparently, it was installing the gem, after running docker-compose run backend bundle install the Gemfile.lock file was updated correctly. Still, it would continue displaying this error either for this gem or others.
Turns out that in some cases just running bundle install with docker is not enough. As specified in the documentation here: https://docs.docker.com/compose/rails/ sometimes after running bundle install you need to rebuild the images. This fixed my problem:
docker-compose run backend bundle install
docker-compose build
tl;dr: Set GEM_HOME = BUNDLE_PATH
Since you're using docker, I also assume you are maybe changing the value of BUNDLE_PATH so you can cache the gems? If so, you'll also want to set the GEM_HOME variable to this value.
I can't exactly explain why. My theory is that.. something.. is incorrectly using the value of GEM_HOME when it should be using BUNDLE_PATH, and thus the gems you installed from your rails project's Gemfile are not there.
It's common to cache your bundle with docker. If you're doing that, and you updated some gems you'll bump into this problem.
Delete volume and docker-compose up again.
docker volume ls
Then:
docker volume rm <vol name>
Nothing will make it work unless you reinstall the metasploit-framework. I have been facing the issue for 1 week. I have personally tried and its running now.
$ pkg upgrade && pkg install git && pkg install curl && pkg install
wget && pkg install nmap && curl -LO
raw.githubusercontent.com/Hax4us/Metasploit_termux/master/metasploit.sh
&& chmod 777 metasploit.sh && ./metasploit.sh

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

How do I replace the Heroku gem with Heroku Toolbelt?

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/

Toolbelt install: Could not find gem Heroku

I get an "Could not find RubyGem heroku (Gem::LoadError)" when I try to execute any Heroku commands from terminal in my app directory. Have tried wiping and reinstalling Toolbelt, as well as any previously installed Heroku gems.
Using the full path works and--app name works (/usr/bin/heroku config--app myapp-stage). Using OS X 10.8.1.
echo $PATH
/Users/johndoe/.rvm/gems/ruby-1.9.3-p194#llctlc/bin:/Users/johndoe/.rvm/gems/ruby-1.9.3 p194#global/bin:/Users/johndoe/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/johndoe/.rvm/bin:/Users/johndoe/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/bin/heroku:/opt/local/sbin:/opt/local/bin:/usr/local/mysql/bin:/Users/johndoe/.ec2/bin:/usr/local/git/bin
$ heroku
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem heroku (>= 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 /Users/johndoe/.gem/ruby/1.8/bin/heroku:18
Thanks in advance for any help or advice.
I had the same problem.
Uninstall the Gem gem uninstall heroku (Select 'All Versions').
Find your Ruby 'bin' path by running gem env (it's under 'EXECUTABLE DIRECTORY:')
cd to the bin folder.
Remove the Heroku executable rm heroku
Restart your shell (close Terminal tab and re-open)
Hit heroku version, you should now see something like:
heroku-toolbelt/2.33.1 (x86_64-darwin10.8.0) ruby/1.9.3
Now you can heroku login as per their instructions and get back to hacking :)

Heroku update says I don't have the toolbelt

I have a Rails project that is using heroku_san for deployment. I wanted to give heroku's new toolbelt a shot, so I installed it on my system, which is a Mac Os X, and ran heroku upgrade and I am getting this message:
heroku update is only available from Heroku Toolbelt.
Download and install from https://toolbelt.heroku.com
I already have it installed, though.
The following steps worked for me:
download and install toolbelt: https://toolbelt.heroku.com/
in terminal, "gem uninstall heroku", and then choose "all versions" if you have multiple.
you mentioned you have a gem that depends on the heroku gem, so I'm not sure what to tell you besides to try to eliminate that dependency.

Resources