What are the causes and fix of Heroku's NoMethodError? - heroku

Just last night, I was executing "heroku pg:psql" on my computer, but this morning I am greeted with the following:
H:\MyName\My Documents\MyOrg\Heroku\MyApp>heroku pg:psql
! 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 `map' for #<String:0x346eae0> (NoMethodError)
Backtrace: C:/Users/myname/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:99:in `app_attachments'
C:/Users/myname/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:104:in `hpg_databases'
C:/Users/myname/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:159:in `hpg_resolve'
C:/Users/myname/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:58:in `resolve'
C:/Users/myname/.heroku/client/lib/heroku/command/pg.rb:91:in `psql'
C:/Users/myname/.heroku/client/lib/heroku/command.rb:218:in `run'
C:/Users/myname/.heroku/client/lib/heroku/cli.rb:37:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Command: heroku pg:psql
Version: heroku/toolbelt/3.9.5 (i386-mingw32) ruby/1.9.3
Why would this error suddenly arise while I slept, and, moreover, how can I fix it?

Someone broke Heroku Toolbelt, but a fix is in now:
https://status.heroku.com/incidents/650
https://github.com/heroku/heroku/commit/784b1d1439bbd044afd892403a2e63b9114546fb

Related

Building gem throws IOError

Trying to build a gem like so.
gem build my-awesome-theme.gemspec
And for some unknown reason it's throwing the following error.
/Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package/tar_writer.rb:249:in `write': closed stream (IOError)
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package/tar_writer.rb:249:in `close'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package/tar_writer.rb:87:in `ensure in new'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package/tar_writer.rb:87:in `new'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package.rb:231:in `block in build'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package.rb:230:in `open'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package.rb:230:in `build'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/package.rb:111:in `build'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/commands/build_command.rb:48:in `execute'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/command.rb:305:in `invoke_with_build_args'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/command_manager.rb:167:in `process_args'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/command_manager.rb:137:in `run'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/gem_runner.rb:54:in `run'
from /Users/robertrawlins/.rvm/rubies/ruby-2.3.1/bin/gem:21:in `<main>'
Have tried complete rebuild of the ruby environment using RVM, and fresh clone of the gem source from GitHub but the problem persists.
Running Mac OSX, RVM and Ruby 2.3.1
Any help greatly received. :)
Thanks to some help on the #ruby-lang IRC channel I managed to track this issue to an outdated version of rubygems, bumped it from 2.2 to 2.6 and problem appears to have gone away.

cocoapods 0.37.2 error during "pod install"

Im trying out the sinch sdk. I would like to use cocoapods with it. I went ahead and added the podfile to the directory my original project is in. when i run "pod install" i get the following error.
MIGUELs-MacBook-Pro:messaging miguel$ pod install
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.37.2/lib/cocoapods-core/standard_error.rb:88:in `message': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:367:in `handle_exception'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:315:in `rescue in run'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:303:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/command.rb:46:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/bin/pod:44:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
the same happens if i try to do "pod update"
What could i be doing wrong?
Any help or pointers would be greatly appreciated
ok, so i analyzed my "podfile and noticed the the (') were wrong. If anyone is facing this issue make sure that the correct is added infront and end of each library by pressing (control and ").
hoep it helps anyone out there

heroku client internal error - console timing out

heroku logs works, but heroku run console times out:
Running `console` attached to terminal... up, run.7335
! 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: Operation timed out - connect(2) (Errno::ETIMEDOUT)
Backtrace: /Users/username/.heroku/client/lib/heroku/client/rendezvous.rb:40:in `initialize'
/Users/username/.heroku/client/lib/heroku/client/rendezvous.rb:40:in `open'
/Users/username/.heroku/client/lib/heroku/client/rendezvous.rb:40:in `block in start'
/usr/local/heroku/ruby/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
/Users/username/.heroku/client/lib/heroku/client/rendezvous.rb:31:in `start'
/Users/username/.heroku/client/lib/heroku/command/run.rb:132:in `rendezvous_session'
/Users/username/.heroku/client/lib/heroku/command/run.rb:119:in `run_attached'
/Users/username/.heroku/client/lib/heroku/command/run.rb:24:in `index'
/Users/username/.heroku/client/lib/heroku/command.rb:206:in `run'
/Users/username/.heroku/client/lib/heroku/cli.rb:28:in `start'
/usr/bin/heroku:24:in `<main>'
Command: heroku run console
Plugins: heroku-accounts
heroku-fucking-console
Version: heroku-toolbelt/2.39.4 (x86_64-darwin10.8.0) ruby/1.9.3
It looks like heroku run:console has been removed:
'heroku run:console' has been removed. Please use: `heroku run` instead.
Perhaps try doing:
heroku run bash

Getting error on heroku cedar stack when running 'heroku run bash' from cli

I'm trying to just get into bash on Heroku Cedar stack and I'm getting the following:
$ heroku run bash
Running `bash` attached to terminal... up, run.1
/usr/local/heroku/lib/heroku/client/rendezvous.rb:87:in `fixup': undefined method `force_encoding' for "\e[01;34m~\e[00m \e[01;32m$ \e[00m":String (NoMethodError)
from /usr/local/heroku/lib/heroku/client/rendezvous.rb:63:in `start'
from /usr/local/heroku/lib/heroku/client/rendezvous.rb:46:in `loop'
from /usr/local/heroku/lib/heroku/client/rendezvous.rb:46:in `start'
from /usr/local/heroku/lib/heroku/command/run.rb:118:in `rendezvous_session'
from /usr/local/heroku/lib/heroku/command/run.rb:104:in `run_attached'
from /usr/local/heroku/lib/heroku/command/run.rb:21:in `index'
from /usr/local/heroku/lib/heroku/command.rb:167:in `send'
from /usr/local/heroku/lib/heroku/command.rb:167:in `run'
from /usr/local/heroku/lib/heroku/cli.rb:9:in `start'
from /usr/bin/heroku:28
Any ideas of what is causing this error or how to remedy it?
Thanks in advance!
What's the heroku command line version? Try upgrading it, whether it's the toolbet or the rubygem.

Precompiling assets with Capistrano shows error on load 'deploy/assets'

I'm using rails 3.1.0 and trying to setup Capistrano to precompile assets. Capistrano v2.8.0 has "load 'deploy/assets'" in Capfile. But when I run "cap deploy" it shows the following error:
cap deploy
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:183:in `find_file_in_load_path': no such file to load -- deploy/assets (LoadError)
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:171:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from Capfile:3:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `each'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:30:in `execute!'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:14:in `execute'
from /usr/bin/cap:4
UPDATE
It magically started working after I restarted my PC (Ubuntu).
Can you please demonstrate that the cap that you are using is indeed in the bundle?
Please share your Gemfile and your Capfile, chances are that "cap" isn't in the bundle, so it's loading a previous version, be sure to run with "bundle exec" (to make sure to use the correct capistrano)
As I encountered the same problem currently, I noticed that using RVM with a project specific .rvmrc was not reloaded after I switched branches with git checkout. The result was that the system wide capistrano version 2.6.0 was being used instead of the project specific capistrano version 2.9.0. This lead to the same error message 'no such file to load -- deploy/assets (LoadError)'.
A simple cd out of the project path and again into the project path solved the problem for me.
What worked for me for this issue was installing the latest version of capistrano (gem install capistrano).

Resources