ruby 1.9.3-p125 Operation not permitted #10629

Closed
kwave opened this Issue Mar 1, 2012 · 9 comments

Projects

None yet

2 participants

@kwave

brew install ruby

results in

==> Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
File already downloaded in /Users/mk/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/ruby/1.9.3-p125 --disable-debug --enable-shared
==> make
==> make install
CC = /usr/bin/llvm-gcc
LD = /usr/bin/llvm-gcc
LDSHARED = /usr/bin/llvm-gcc -dynamiclib
CFLAGS = -Os -w -pipe -march=core2 -msse4.1 -fno-common
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -I/usr/local/Cellar/readline/6.2.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I. -I.ext/include/x86_64-darwin11.3.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /usr/local/Cellar/ruby/1.9.3-p125/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,Init* -Wl,-unexported_symbol,threadptr -Wl,-u,_objc_msgSend

SOLIBS =
generating encdb.h
making srcs under enc
make[1]: Nothing to be done for srcs'.
./miniruby -I./lib -I. -I.ext/common ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="- --jobserver-fds=8,9 -j" --make-flags=" --jobserver-fds=8,9 -j" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --install=all --rdoc-output=".ext/rdoc"
installing binary commands: /usr/local/Cellar/ruby/1.9.3-p125/bin
installing base libraries: /usr/local/Cellar/ruby/1.9.3-p125/lib
encdb.h unchanged
installing arch files: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0
installing pkgconfig data: /usr/local/Cellar/ruby/1.9.3-p125/lib/pkgconfig
installing extension objects: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0
installing extension objects: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/site_ruby/1.9.1/x86_64-darwin11.3.0
installing extension objects: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/vendor_ruby/1.9.1/x86_64-darwin11.3.0
installing extension headers: /usr/local/Cellar/ruby/1.9.3-p125/include/ruby-1.9.1/x86_64-darwin11.3.0
installing extension scripts: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1
installing extension scripts: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/site_ruby/1.9.1
installing extension scripts: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/vendor_ruby/1.9.1
installing extension headers: /usr/local/Cellar/ruby/1.9.3-p125/include/ruby-1.9.1/ruby
installing rdoc: /usr/local/Cellar/ruby/1.9.3-p125/share/ri/1.9.1/system
installing capi-docs: /usr/local/Cellar/ruby/1.9.3-p125/share/doc/ruby
installing command scripts: /usr/local/Cellar/ruby/1.9.3-p125/bin
installing library scripts: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/1.9.1
installing common headers: /usr/local/Cellar/ruby/1.9.3-p125/include/ruby-1.9.1
installing manpages: /usr/local/Cellar/ruby/1.9.3-p125/share/man/man1
installing default gems: /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1 (cache, doc, gems, specifications)
rake 0.9.2.2
rdoc 3.9.4
./tool/rbinstall.rb:259:in
chmod': Operation not permitted - /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/specifications/rdoc-3.9.4.gemspec (Errno::EPERM)
from ./tool/rbinstall.rb:259:in open_for_install'
from ./tool/rbinstall.rb:559:in
block (2 levels) in

'
from ./tool/rbinstall.rb:542:in foreach'
from ./tool/rbinstall.rb:542:in
block in '
from ./tool/rbinstall.rb:597:in call'
from ./tool/rbinstall.rb:597:in
block (2 levels) in '
from ./tool/rbinstall.rb:594:in each'
from ./tool/rbinstall.rb:594:in
block in '
from ./tool/rbinstall.rb:590:in each'
from ./tool/rbinstall.rb:590:in
'
make: *** [do-install-all] Error 1
Error: Permission denied - config.log or /Users/mk/Library/Logs/Homebrew/config.log

@mxcl
Homebrew member

brew doctor please.

@kwave

Sry. Here you are:

brew doctor
Warning: Your Xcode version is outdated
Please install Xcode 4.3.

Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
/usr/local/lib/libao.2.1.2.dylib /usr/local/lib/libid3tag.0.3.0.dylib /usr/local/lib/libmad.0.2.1.dylib /usr/local/lib/libogg.0.5.0.dylib /usr/local/lib/libsocks.0.1.1.dylib /usr/local/lib/libsqlite.0.8.6.dylib /usr/local/lib/libssl.0.9.8.dylib /usr/local/lib/libvorbis.0.3.0.dylib /usr/local/lib/libvorbisenc.2.0.0.dylib /usr/local/lib/libvorbisfile.3.1.0.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
/usr/local/lib/libao.la /usr/local/lib/libid3tag.la /usr/local/lib/libmad.la /usr/local/lib/libmp3lame.la /usr/local/lib/libogg.la /usr/local/lib/libsocks.la /usr/local/lib/libsqlite.la /usr/local/lib/libvorbis.la /usr/local/lib/libvorbisenc.la /usr/local/lib/libvorbisfile.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
/usr/local/lib/pkgconfig/ao.pc /usr/local/lib/pkgconfig/fuse-ext2.pc /usr/local/lib/pkgconfig/sqlite.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
/usr/local/lib/libc-client.a /usr/local/lib/libid3tag.a /usr/local/lib/libmad.a /usr/local/lib/libsocks.a /usr/local/lib/libsqlite.a

@mxcl
Homebrew member

To me it looks like your Cellar has some directories or files in it that are owned by root or chmod’d to permissions that cannot be written to or overwritten.

I suggest chown -R $(whoami) /usr/local/Cellar.

@kwave

did that two times already. I am getting the same error afterwards.

@mxcl
Homebrew member

rm -rf /usr/local/Cellar/ruby/1.9.3-p125 first?

@kwave

This is not necessary as brew removes the whole /usr/local/Cellar/ruby dir as soon as the installation fails.

I've successfully tried a pretty ineffective workaround and finally got ruby installed:
As soon as brew says make install I ran while true; do sudo chown -Rv mk /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/specifications; done in a second terminal. Installation was successful.

I'am pretty sure that somewhere in the installation process the installer locks itself out.

EDIT: Seems like everything which is installed in /usr/local/Cellar/ruby belongs to root per default. Had to do another chown to successfully gem install rails

@mxcl
Homebrew member

How can it become root owned unless you're doing sudo brew install ruby?

@kwave

I've got really no idea. ps reports that brew is running as an unprivileged user. However all files installed by the ruby package are owned by root. This problem appears only with the ruby package - all other packages are owned by me.
Scary error as there should be no way for brew to elevate to root-privs without asking for the password...

@mxcl
Homebrew member

Perhaps you ran something sudo just before and the ruby script calls sudo?

Not that we've seen anything like this before. I'lll grep for sudo usage.

@mxcl mxcl was assigned May 3, 2012
@mxcl mxcl added a commit that closed this issue May 15, 2012
@mxcl mxcl `sudo -k` before calling build scripts
Potentially build scripts would call sudo, if so we don't want that to automatically succeed just because the time-period in which sudo works is still active after a previous incantation.

Closes #10629.

In fact I don't see how this can have been the problem, but if this isn't the problem then I don't see what else can be the problem.
76bab90
@mxcl mxcl closed this in 76bab90 May 15, 2012
@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Jun 18, 2012
@mxcl mxcl `sudo -k` before calling build scripts
Potentially build scripts would call sudo, if so we don't want that to automatically succeed just because the time-period in which sudo works is still active after a previous incantation.

Closes #10629.

In fact I don't see how this can have been the problem, but if this isn't the problem then I don't see what else can be the problem.
21c471b
@chrismetcalf chrismetcalf added a commit to chrismetcalf/homebrew that referenced this issue Jun 18, 2012
@mxcl mxcl `sudo -k` before calling build scripts
Potentially build scripts would call sudo, if so we don't want that to automatically succeed just because the time-period in which sudo works is still active after a previous incantation.

Closes #10629.

In fact I don't see how this can have been the problem, but if this isn't the problem then I don't see what else can be the problem.
5c7777c
@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
@mxcl mxcl `sudo -k` before calling build scripts
Potentially build scripts would call sudo, if so we don't want that to automatically succeed just because the time-period in which sudo works is still active after a previous incantation.

Closes #10629.

In fact I don't see how this can have been the problem, but if this isn't the problem then I don't see what else can be the problem.
4cabce4
@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.