sportngin / brew-gem

Install gems as homebrew formulas
MIT License
195 stars 21 forks source link

gem install brew-gem + brew-gem install brew-gem causes brew link failure #25

Closed AmirIHz closed 8 years ago

AmirIHz commented 8 years ago

23 → https://github.com/sportngin/brew-gem/pull/23/commits/9690c9cd21e3f93ca23ad3a5f8485b603e89c2eb

gem install brew-gem followed by brew-gem install brew-gem, as suggested in README.md, causes the brew link step to fail due to an existing brew-gem executable in /usr/local/bin, which was installed by RubyGems:

$ gem install brew-gem
Fetching: brew-gem-0.7.2.gem (100%)
Successfully installed brew-gem-0.7.2
Parsing documentation for brew-gem-0.7.2
Installing ri documentation for brew-gem-0.7.2
Done installing documentation for brew-gem after 6 seconds
1 gem installed
$ brew-gem install brew-gem
==> Fetching brew-gem from gem source
Fetching: brew-gem-0.7.2.gem (100%)
Downloaded brew-gem-0.7.2
Warning: Cannot verify integrity of brew-gem-0.7.2.gem
A checksum was not provided for this resource
For your reference the SHA256 is: 7e9621043536b27d4423c40da3a71c5d1546963e671b68ecaa2d27129014d5c7
==> gem install /Library/Caches/Homebrew/brew-gem-0.7.2.gem --no-ri --no-rdoc --no-wrapper --no-user-install --install-dir /usr/local/Cellar/gem-brew-
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/brew-gem
Target /usr/local/bin/brew-gem
already exists. You may want to remove it:
  rm '/usr/local/bin/brew-gem'

To force the link and overwrite all conflicting files:
  brew link --overwrite gem-brew-gem

To list all files that would be deleted:
  brew link --overwrite --dry-run gem-brew-gem

Possible conflicting files are:
/usr/local/bin/brew-gem
==> Summary
🍺  /usr/local/Cellar/gem-brew-gem/0.7.2: 19 files, 24K, built in 14 seconds

If you have installed brew-gem as gem, do you really need to brew-gem it? Wouldn't it be redundant? On the other hand one might want brew-gem to be in the Cellar as well...

The Warning: Cannot verify integrity of brew-gem-0.7.2.gem A checksum was not provided for this resource warning should probably be a separate issue (like #24)... ;-)

nicksieger commented 8 years ago

Good point, I think the assumption here when you brew-gem install brew-gem is that you haven't already installed it in Homebrew. Probably worth updating the docs to point that out.

AmirIHz commented 8 years ago

Thank you for your response. However, with all due respect, I believe you misunderstood me. I wasn't actually referring to a previous Homebrew installation of brew-gem, but the RubyGems install instructions in README.md:

Via Rubygems:

gem install brew-gem
brew-gem install brew-gem

Via Homebrew:

brew install brew-gem

These Via Rubygems instructions (first do a RubyGems install, followed by a brew-gem installation) cause the brew link step failure. The other way around (Homebrew installation followed by RubyGems installation) I haven't tested yet. I will do so as soon as I get home. ;-)

At any rate I think this issue should be reopened as it hasn't been resolved.

Update: a previously via Homebrew installed (and linked) brew-gem would indeed cause problems both with a RubyGems install and a brew-gem install. Nonetheless that isn't what I tried to point out by opening this issue as that in fact works as designed; the steps in README.md don't.

nicksieger commented 8 years ago

Ok, so it still sounds like a documentation issue. The point is that you should choose one installation method and stick with that, but it sounds like you tried both in succession?

anfleene commented 8 years ago

@AmirIHz I think https://github.com/sportngin/brew-gem/commit/317098c092a758cdc492ce49db6fe49eb1f0b018 clears up the documentation well enough.

AmirIHz commented 8 years ago

@nicksieger uhhhhh nope, I'm just following the official README.md instructions:

Via Rubygems:

gem install brew-gem
brew-gem install brew-gem

which doesn't state you shouldn't run both commands and pick either one. Which wouldn't make much sense as brew-gem install brew-gem wouldn't work if you hadn't previously installed brew-gem in the first place. So yes, it's a documentation issue.

I hadn't used the classic Homebrew method before filing this issue, however, I did try several cases, just to be sure. Anyway, this issue isn't a show-stopper for me personally. I just think it would be a problem for other people who follow your documented RubyGems method to the letter, and aren't as tech-savvy as I am. Documentation should be tested as well. ;-)

For the record, after experiencing the failure I just uninstalled both the gem and the Homebrew gem-brew-gem and stuck with just the gem install brew-gem and skipped the brew-gem install brew-gem which seems redundant to me anyway. I just thought you should know about it. I'm only trying to help.

@anfleene nope, try again.