Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Cannot load such file netrc #1057

Closed
christhekeele opened this issue Mar 18, 2014 · 13 comments
Closed

Cannot load such file netrc #1057

christhekeele opened this issue Mar 18, 2014 · 13 comments

Comments

@christhekeele
Copy link

We're using Atlassian's Bamboo with Amazon's EC2 for continuous integration.

A few days ago the heroku toolbelt stopped working on the instance:

$ heroku -v
/usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- netrc (LoadError)
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku/auth.rb:6:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku/client.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku.rb:1:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku/cli.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/bin/heroku:22:in `<main>
$ which heroku
/usr/local/heroku/bin/heroku
$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [i686-linux]
$ which ruby
/usr/local/bin/ruby

The OS is the default linux installation EC2 offers.

Every morning, the instance is rebuilt from scratch. Ruby is built with the fairly trivial flags --prefix=$PREFIX --enable-shared --disable-install-doc --with-opt-dir=$PREFIX/lib.

The toolbelt is installed not as a gem, but through the script: wget -qO- https://toolbelt.heroku.com/install.sh | sh.

Installing the gem seems to fix things, but I was under the impression this isn't the correct way to use the toolbelt anymore.

@catsby
Copy link
Contributor

catsby commented Mar 18, 2014

The Toolbelt release may be out of date in the default installer. Can you run $ heroku version and let me know what it says?

@christhekeele
Copy link
Author

Sadly,

$ heroku version
/usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- netrc (LoadError)
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku/auth.rb:6:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku/client.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku.rb:1:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/lib/heroku/cli.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/local/heroku/bin/heroku:22:in `<main>'

However,

$ cat /usr/local/heroku/lib/heroku/version.rb
module Heroku
  VERSION = "3.6.0"
end

This is the same version number that the working gem reports.

@christhekeele
Copy link
Author

As far as I can tell the only differences between the two are in the bin/heroku binstub itself, according to this hacky git diff method.

@phill-atlassian
Copy link

@christhekeele - I had to manually add in

gem install netrc && gem install heroku-api

in our instance startup script as a workaround for the moment. We are looking into this in more detail.

@christhekeele
Copy link
Author

Thanks! Let me know if I can assist.

@jeffmcfadden
Copy link

We've hit the same issue attempting to deploy to Heroku from Semaphoreapp. They had just updated their version of heroku tool belt as well.

@catsby
Copy link
Contributor

catsby commented Apr 4, 2014

Can you show me the contents of /usr/local/heroku/vendor/gems?:

$ ls -la /usr/local/heroku/vendor/gems 
drwxr-xr-x  10 clint  staff  340 Dec 16 16:45 .
drwxr-xr-x   3 clint  staff  102 Dec 16 16:45 ..
drwxr-xr-x  12 clint  staff  408 Dec 16 16:45 addressable-2.3.2
drwxr-xr-x  12 clint  staff  408 Dec 16 16:45 excon-0.25.3
drwxr-xr-x  11 clint  staff  374 Dec 16 16:45 heroku-api-0.3.15
drwxr-xr-x  12 clint  staff  408 Dec 16 16:45 launchy-2.3.0
drwxr-xr-x  16 clint  staff  544 Dec 16 16:45 mime-types-1.21
drwxr-xr-x   8 clint  staff  272 Dec 16 16:45 netrc-0.7.7
drwxr-xr-x   9 clint  staff  306 Dec 16 16:45 rest-client-1.6.7
drwxr-xr-x   8 clint  staff  272 Dec 16 16:45 rubyzip-0.9.9

@christhekeele
Copy link
Author

There doesn't seem to be a vendor in my /usr/local/heroku. Same output as noted in #1071. Closest thing is /usr/local/heroku/lib/vendor/ which only contains heroku/okjson.rb.

@methyl
Copy link

methyl commented Apr 9, 2014

@jeffmcfadden I used gem install netrc && gem install heroku-api as first deploy command on Semaphore as a workaround

@tony-f
Copy link

tony-f commented Apr 24, 2014

The workaround on Semaphore using the gem install netrc && gem install heroku-api as first deploy command works well for us also...thx @jeffmcfadden

@pedro
Copy link
Contributor

pedro commented May 2, 2014

Hey folks,

So sorry for the trouble! The root cause here is that we released an update for the Toolbelt that didn't include vendored gems. This should have been fixed starting on 3.7. You can update with heroku update or by re-installing the toolbelt if that doesn't work.

Thanks,

@pedro pedro closed this as completed May 2, 2014
@christhekeele
Copy link
Author

Excellent, thank you!

@tony-f
Copy link

tony-f commented May 3, 2014

Awesome! Thanks!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants