This repository has been archived by the owner. It is now read-only.

Cellar not created by install_homebrew.rb #5188

Closed
daenney opened this Issue Apr 13, 2011 · 30 comments

Comments

Projects
None yet
Contributor

daenney commented Apr 13, 2011

When a user follows the instruction on the wiki and executes:
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"

switch:~ daenney$ brew update
Initialized empty Git repository in /usr/local/.git/
remote: Counting objects: 35497, done.
remote: Compressing objects: 100% (16355/16355), done.
remote: Total 35497 (delta 20742), reused 31953 (delta 18582)
Receiving objects: 100% (35497/35497), 4.84 MiB | 1.88 MiB/s, done.
Resolving deltas: 100% (20742/20742), done.
From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
Error: No such file or directory - /usr/local/Cellar`

This directory should be created by install_homebrew.rb somewhere along the lines of:

ohai "This script will install:"
puts "/usr/local/bin/brew"
puts "/usr/local/Library/Formula/..."
puts "/usr/local/Library/Homebrew/..."
Contributor

adamv commented Apr 13, 2011

Possibly related to this: mxcl#5128

But also the install instructions always bring down the very latest version, so it's possible we've never tried install+update right after each other before.

Contributor

daenney commented Apr 14, 2011

That one seems unrelated, or at least partially as it managed to install git just fine into Cellar. Perhaps the crux is that on a brew install Cellar is created if it doesn't exist. Since he runs an install first the update will not fail on the fact that Cellar is not there because it has already been created.

In my case, I haven't installed anything except for brew itself, running update immediately after without having installed a formula causes my error.

I've had this error with the same workflow on three machines now, with a brew install some_formula before running update everything goes fine.

Member

mxcl commented Apr 14, 2011

The Cellar shouldn't be created by the install script. The bug is in brew update.

@mxcl mxcl was assigned Apr 14, 2011

Why shouldn't it? I'm asking because I just did a reinstall of Homebrew and after installing git the first thing I did was brew doctor and it also told me that the Cellar was missing. If this would only be fixed in brew update, I'd suggest to also update brew doctor with one more line telling the user (how) to create the missing directory instead of only telling them that it is missing.

Member

mxcl commented Apr 24, 2011

@adamv is there any reason doctor reports that as a problem? Maybe we need to rephrase it.

Contributor

adamv commented Apr 24, 2011

If the Cellar does exist there are a couple of checks that brew doctor does; should probably rewrite those tests to skip if the cellar doesn't exist yet.

Contributor

adamv commented Jun 4, 2011

brew doctor now doesn't freak out if the Cellar doesn't exist. Closing in favor of the other open brew update bug.

@adamv adamv closed this Jun 4, 2011

You should consider reopening this issue. I just installed Homebrew on two Lion machines, and neither one created the Cellar (even after running brew update).

Ultimately, I just created the Cellar directory manually to work around this issue. But, still, I'd like to see this fixed.

colby commented Sep 10, 2011

I believe it creates Cellar when you download your first formula.

rrecio commented Sep 12, 2011

No, it doesnt. I just have installed brew -> updated -> tried to install mysql -> No Cellar directory!

Contributor

Sharpie commented Sep 12, 2011

@rrecio

Whenever something is installed (copied) to a directory that does not exist Pathname.mkpath, the equivalent of mkdir -p, should be invoked (as implemented in extend/pathname.rb).

If this is not happening then there may be some sort of bug. If you could provide the output of brew install -v mysql in a gist, we would have a better idea of what is going on.

kalaxy commented Sep 13, 2011

I'm hit by the same issue. Fresh install from ruby script, did brew update, and I can't install anything due to the Cellar issue. Here is my output for brew install -v mysql:

$ brew install -v mysql
==> Installing mysql dependency: cmake
==> Downloading http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7) http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz -o /Users/kmills/Library/Caches/Homebrew/cmake-2.8.5.tar.gz
######################################################################## 100.0%
/usr/bin/tar xf /Users/kmills/Library/Caches/Homebrew/cmake-2.8.5.tar.gz
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7) http://cmake.org/gitweb?p=cmake.git;a=patch;h=702538eaa3315f3fcad9f1daea01e6a83928967b -o 001-homebrew.diff
######################################################################## 100.0%
==> Patching
/usr/bin/patch -f -p1 -i 001-homebrew.diff
patching file Modules/FindQt4.cmake
Error: Permission denied - /usr/local/Cellar
$
Contributor

Sharpie commented Sep 13, 2011

I could not reproduce this on a clean install of Leopard or a clean install of Snow Leopard---both were able to download, compile and install MySQL successfully. At this point, my best guess is that this may have something to do with the version of Git supplied by XCode on Lion. I cannot confirm as I don't run Lion myself.

I would suggest opening a new issue as the current problems don't have anything to do with install_homebrew.rb.

Contributor

daenney commented Sep 14, 2011

Eh Error: Permission denied - /usr/local/Cellar.

Your user is not allowed to create/modify Cellar, perhaps a sudo chown -Rwhoami/usr/local would fix a few things?

Contributor

jacknagel commented Sep 14, 2011

Yes, please ensure that your user/group permissions haven't been modified somehow; your user and/or group need write permission on /usr/local in order to create directories/files underneath it.

kalaxy commented Sep 14, 2011

Fixed, thank you! It was just a permissions problem.

Thinking back my actual order of events, they were: install brew via the ruby script, upgrade to Lion, install Xcode, then try to brew install something. I specifically looked at the permissions of the /usr/local directory before and after the brew installer script to ensure that they were correct. I didn't even thing to check the permissions again. I wonder if either the Lion install or the Xcode install reverted the user/group or /usr/local.

Side note: For one reason or another the error message Error: Permission denied - /usr/local/Cellar was not enough to indicate the problem to me a noobie homebrew user. My initial thought was, "well yeah, it doesn't exist, so do I need to create it?" Hence finding this thread on creating the Cellar directory. The same error message was given by brew doctor. It would be nice, at lease in the doctor case, to have a more descriptive message stating the actual problem and a potential resolution.

Contributor

daenney commented Sep 15, 2011

Actually, had you looked at the Wiki and specifically this page: https://github.com/mxcl/homebrew/wiki/Checklist-before-filing-a-new-issue

The sixth bullet-point on the checklist section...

Granted you didn't file a new bug and granted it could be made a bit clearer.

Member

mxcl commented Sep 15, 2011

The way to know it was a permissions problem was that it said Error: Permission denied - /usr/local/Cellar. But it's okay.

@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 19, 2011

@mxcl mxcl Check Cellar can be made before installing stuff
Refs #5188.
e0cad12

@martinploeger martinploeger added a commit to martinploeger/homebrew that referenced this issue Oct 8, 2011

@mxcl @martinploeger mxcl + martinploeger Check Cellar can be made before installing stuff
Refs #5188.
751a5c0

@etehtsea etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 27, 2011

@mxcl mxcl Check Cellar can be made before installing stuff
Refs #5188.
810e49f

iandees commented Mar 27, 2012

On my brand spanking new 10.7.3 MacBook with XCode installed I ran the ruby installer script as recommended from the home page: /usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)". After the install was successful it said:

==> Installation successful!
You should run `brew doctor' *before* you install anything.
Now type: brew help

That's a bit confusing, so I typed "brew help" which didn't really tell me anything beyond command line args. Then I typed brew doctor and got the following:

$ brew doctor
Error: No such file or directory - /usr/local/Cellar

Looks like this bug still exists?

Contributor

Sharpie commented Mar 27, 2012

Looks like this bug still exists?

The Cellar gets created by the first formula that you install. Some commands will error out if the Cellar is not present, but there is no need to run these commands until you have built a formula.

iandees commented Mar 27, 2012

So then it's a documentation bug? The installer shouldn't tell me to run a command that will immediately fail, right?

Contributor

daenney commented Mar 27, 2012

I have to agree with @iandees here. The script is clearly advising him to run brew doctor before installing anything but that is bound to fail since brew doctor needs Cellar to exist... catch22

Contributor

mistydemeo commented Mar 27, 2012

Since Cellar is created by the first formula that's installed, I don't think we need a brew doctor check as to whether it exists.

Maybe the installer could create Cellar?

I agree, something needs to be done. It's very confusing to install brew, be told to run brew doctor to verify everything is OK, and then be told there is an error... on a plain mac that hasn't got anything else installed yet (except Xcode of course, which was the first thing brew doctor told me to fix).

Contributor

mistydemeo commented Apr 8, 2012

This should be fixed (again) by da51cc5. Sorry about this.

@ColinHebert ColinHebert pushed a commit to ColinHebert/homebrew that referenced this issue Apr 8, 2012

@mistydemeo mistydemeo doctor: skip Cellar checks if Cellar doesn't exist
Attempting to call certain methods on the Cellar before it exists,
such as realpath, would cause brew doctor to throw unnecessary "file
does not exist" errors. This was fixed once before, but new tests
have been added since without the appropriate checks.
cf. 0d28bc7

Fixes #5188 (again).
da51cc5

@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Jun 18, 2012

@mistydemeo mistydemeo doctor: skip Cellar checks if Cellar doesn't exist
Attempting to call certain methods on the Cellar before it exists,
such as realpath, would cause brew doctor to throw unnecessary "file
does not exist" errors. This was fixed once before, but new tests
have been added since without the appropriate checks.
cf. 0d28bc7

Fixes #5188 (again).
a2eaec7

aaronpk commented Jun 19, 2012

This is still an issue for me. So far, on a brand new install I've done:

  • Ran the installer script pasted from the Installation wiki page
  • It complained that it couldn't find xcode compiler tools, etc
  • I installed XCode compiler tools
  • I installed git from here http://code.google.com/p/git-osx-installer/
  • Ran brew doctor again, now it just says "Error: No such file or directory - /usr/local/Cellar"

and now I'm completely stuck.

Contributor

adamv commented Jun 19, 2012

@aaronpk have you tried installing something? Some times brew doctor will report an error before the first brew is installed.

@samueljohn samueljohn pushed a commit to samueljohn/homebrew that referenced this issue Jun 19, 2012

@mistydemeo mistydemeo doctor: skip Cellar test if Cellar doesn't exist
Fixes #5188 (again).
7718270
Contributor

mistydemeo commented Jun 19, 2012

This may be fixed by 7718270. A test was checking against the cellar and possibly could have been causing the "no such file or directory" error. If you're still seeing this, can you let me know?

It's not actually a fatal error, but I'd like to fix these regressions so that brew doctor doesn't pop up unhelpful error messages.

@mistydemeo mistydemeo added a commit that referenced this issue Jun 19, 2012

@mistydemeo mistydemeo doctor: skip missing_deps when no Cellar exists
Another fix for #5188.
4ed3c71
Contributor

mistydemeo commented Jun 19, 2012

OK, it looks like it was actually a different check causing the issue - that is fixed in 4ed3c71. I tested by removing my own Cellar, and there should be no further errors at this point.

@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Jun 25, 2012

@mistydemeo mistydemeo doctor: skip Cellar test if Cellar doesn't exist
Fixes #5188 (again).
4cbd724

@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Jun 25, 2012

@mistydemeo mistydemeo doctor: skip missing_deps when no Cellar exists
Another fix for #5188.
db606cd

@eproxus eproxus added a commit to eproxus/homebrew that referenced this issue Jul 18, 2012

@mistydemeo @eproxus mistydemeo + eproxus doctor: skip Cellar test if Cellar doesn't exist
Fixes #5188 (again).
7ba32fc

@eproxus eproxus added a commit to eproxus/homebrew that referenced this issue Jul 18, 2012

@mistydemeo @eproxus mistydemeo + eproxus doctor: skip missing_deps when no Cellar exists
Another fix for #5188.
f7a3b7a

@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012

@mxcl mxcl Check Cellar can be made before installing stuff
Refs #5188.
aea8e47

@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012

@mistydemeo mistydemeo doctor: skip Cellar checks if Cellar doesn't exist
Attempting to call certain methods on the Cellar before it exists,
such as realpath, would cause brew doctor to throw unnecessary "file
does not exist" errors. This was fixed once before, but new tests
have been added since without the appropriate checks.
cf. 0d28bc7

Fixes #5188 (again).
69a9aad

@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012

@mistydemeo mistydemeo doctor: skip Cellar test if Cellar doesn't exist
Fixes #5188 (again).
f50a3db

@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012

@mistydemeo mistydemeo doctor: skip missing_deps when no Cellar exists
Another fix for #5188.
77f1c16

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.