Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant CurlDownloadStrategy #2275

Closed
brianpartridge opened this issue Jan 2, 2014 · 20 comments
Closed

uninitialized constant CurlDownloadStrategy #2275

brianpartridge opened this issue Jan 2, 2014 · 20 comments

Comments

@brianpartridge
Copy link

I experience the following error when searching for a cask. I would report it to homebrew as it suggests, but regular homebrew searches work fine, so I assume this is a cask problem. This is from a fresh install of cask.

            [~]$ brew cask search chrome
            Error: uninitialized constant CurlDownloadStrategy
            Please report this bug:
                https://github.com/mxcl/homebrew/wiki/troubleshooting
            /usr/local/Cellar/brew-cask/cask/rubylib/cask/download_strategy.rb:3
            /usr/local/Cellar/brew-cask/cask/rubylib/cask.rb:13:in `require'
            /usr/local/Cellar/brew-cask/cask/rubylib/cask.rb:13
            /usr/local/bin/brew-cask.rb:4:in `require'
            /usr/local/bin/brew-cask.rb:4
            /usr/local/bin/brew:51:in `require'
            /usr/local/bin/brew:51:in `require?'
            /usr/local/bin/brew:91
@rolandwalker
Copy link
Contributor

I cannot duplicate this (and @brianpartridge I suggest running brew upgrade brew-cask), but maybe we ought to

require 'download_strategy'

(no path) in lib/cask/download_strategy.rb in order to pull in Homebrew's download_strategy.rb ?

@deanrad
Copy link

deanrad commented Jan 5, 2014

Same error. It was a fresh install yesterday, but I did brew upgrade brew-cask anyway - still get the error.

@deanrad
Copy link

deanrad commented Jan 6, 2014

I can verify that @rolandwalker's require allows brew cask to get past the download strategy. However, for chrome it then says no available cask for chrome, and for dash, the error is Error: no such file to load -- software_spec...

@rolandwalker
Copy link
Contributor

Yes, chrome is spelled google-chrome in this project.

However it seems like there is another problem. software_spec.rb is also part of the Homebrew project. So your problem is that Homebrew files are not getting required as they should.

Also, similar to #2267 .

@phinze
Copy link
Contributor

phinze commented Jan 6, 2014

Hmm yeah these are errors in requiring the code we borrow from homebrew proper.

I wonder what changed that they're showing up now... will try to research further.

@rolandwalker
Copy link
Contributor

If anyone who can duplicate the issue feels comfortable with a hot edit on /usr/local/bin/brew-cask.rb, there are two things to try:

  • for information: insert a line puts $LOAD_PATH at line 4, run brew cask, and send us the output
  • for a possible fix: change line 3 to $LOAD_PATH.unshift(File.expand_path('../../rubylib', Pathname.new(__FILE__).realpath))

On our side: we should probably create a brew cask doctor at some point.

rolandwalker added a commit to rolandwalker/homebrew-cask that referenced this issue Jan 6, 2014
Found while investigating Homebrew#2275, but probably not a fix, just a sensible
change. Depending on version of ruby interpreter, previous code could
cause brew-cask paths to came later than current dir "." in $LOAD_PATH,
leading to unpredictable behavior in the wild.
rolandwalker added a commit to rolandwalker/homebrew-cask that referenced this issue Jan 6, 2014
@davidpaulsson
Copy link

I also get this error right after installing ...

$ brew cask search spotify
Error: uninitialized constant CurlDownloadStrategy
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Cellar/brew-cask/0.25.0/rubylib/cask/download_strategy.rb:3
/usr/local/Cellar/brew-cask/0.25.0/rubylib/cask.rb:13:in `require'
/usr/local/Cellar/brew-cask/0.25.0/rubylib/cask.rb:13
/usr/local/bin/brew-cask.rb:4:in `require'
/usr/local/bin/brew-cask.rb:4
/usr/local/Library/brew.rb:51:in `require'
/usr/local/Library/brew.rb:51:in `require?'
/usr/local/Library/brew.rb:101

@phinze
Copy link
Contributor

phinze commented Jan 10, 2014

@davidpaulsson let me try cutting a release to see if b15f7bd45a424f6f14075c7f7354d0b7898378b3 fixes this.

@phinze
Copy link
Contributor

phinze commented Jan 10, 2014

Okay just pushed v0.26.0 - can you upgrade and see if the issue persists? 🎌

@davidpaulsson
Copy link

@phinze I'm not so sure how to update stuff, so I uninstalled brew-cask and untaped phinze/cask first. But I still get this:

==> Checking out tag v0.26.0
/usr/local/Cellar/brew-cask/0.26.0: 1063 files, 4.2M, built in 31 seconds
$ brew cask search spotify
Error: uninitialized constant CurlDownloadStrategy
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Cellar/brew-cask/0.26.0/rubylib/cask/download_strategy.rb:3
/usr/local/Cellar/brew-cask/0.26.0/rubylib/cask.rb:13:in `require'
/usr/local/Cellar/brew-cask/0.26.0/rubylib/cask.rb:13
/usr/local/bin/brew-cask.rb:4:in `require'
/usr/local/bin/brew-cask.rb:4
/usr/local/Library/brew.rb:51:in `require'
/usr/local/Library/brew.rb:51:in `require?'
/usr/local/Library/brew.rb:101

@phinze
Copy link
Contributor

phinze commented Jan 10, 2014

Garg - okay let me try one more thing and push you a bugfix release.

Next update you can just do brew update && brew upgrade brew-cask to get the new version.

Thanks for bearing with me! 🐻

@phinze
Copy link
Contributor

phinze commented Jan 10, 2014

Oh does brew cask doctor work for you, if so could you gist the output of it?

@davidpaulsson
Copy link

Ok thank you!

Nope, unfortunately not. :s ... Same error, I think:

$ brew cask doctor
Error: uninitialized constant CurlDownloadStrategy
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Cellar/brew-cask/0.26.0/rubylib/cask/download_strategy.rb:3
/usr/local/Cellar/brew-cask/0.26.0/rubylib/cask.rb:13:in `require'
/usr/local/Cellar/brew-cask/0.26.0/rubylib/cask.rb:13
/usr/local/bin/brew-cask.rb:4:in `require'
/usr/local/bin/brew-cask.rb:4
/usr/local/Library/brew.rb:51:in `require'
/usr/local/Library/brew.rb:51:in `require?'
/usr/local/Library/brew.rb:101

phinze added a commit that referenced this issue Jan 10, 2014
@phinze
Copy link
Contributor

phinze commented Jan 10, 2014

Okay @davidpaulsson if you've got a few more minutes to help us out here, can you install from master to see if 0967e4d helps?

brew update
brew install --HEAD brew-cask

@davidpaulsson
Copy link

Hey, it works now! 👍 Yay!

@phinze
Copy link
Contributor

phinze commented Jan 10, 2014

Phew - okay cutting a bugfix release. Can you now kick us the output of brew cask doctor so we can see what's happening here?

Thanks so much for your time to help the project out! 🍻

@davidpaulsson
Copy link

Sure! No, thank you for getting this issue resolved.

$ brew cask doctor
==> Ruby Version:
1.8.7-p358
==> Contents of $LOAD_PATH:
/usr/local/Cellar/brew-cask/HEAD/rubylib
/usr/local/Library/Homebrew
/usr/local/Library/Homebrew/vendor
/Library/Ruby/Site/1.8
/Library/Ruby/Site/1.8/powerpc-darwin13.0
/Library/Ruby/Site/1.8/universal-darwin13.0
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin13.0
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin13.0
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin13.0
.
==> Running As Privileged User:
No

@rolandwalker
Copy link
Contributor

@davidpaulsson I also thank you for being generous with your time.

The doctor output looks correct as far as it goes. If I can get around to expanding the doctor's capabilities, I might ping you to run it again in some future release. I think there is still something fundamentally wrong, we have just successfully compensated for it.

PS you are still running from brew-cask from HEAD at this point. To switch back to the release:

brew rm brew-cask && brew install --fresh brew-cask

@phinze
Copy link
Contributor

phinze commented Jan 10, 2014

Aaaand scene! 🎥

Others on this thread - upgrade to fix, reopen if you still have issues!

@phinze phinze closed this as completed Jan 10, 2014
@brianpartridge
Copy link
Author

Thanks everyone, it works as expected now.

@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
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

5 participants