Installing Homebrew on Yosemite

One of the downsides of playing with beta software is that your stuff breaks. For OS X 10.10 (Yosemite), Homebrew was one of those things.

Here’s how I fixed it:

  1. Nuke the previous one.

    rm -rf /usr/local/Cellar

  2. Install the new one.

    ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/
    homebrew/go/install)”

  3. Run Brew Doctor.

    brew doctor

  4. Clean up any issues.
  5. Install your software.

Now you’ll be running with Ruby 2.x (default in Yosemite) as well as the latest Homebrew.

Fixing Homebrew for OS X 10.10 Yosemite

Now that Apple opened up the beta program of their Desktop OS to everyone (not requiring a developer license anymore) a lot of people will be upgrading to OS X 10.10 already before the official release later on this year. I did it as well earlier this week, however I found out that one of my all time favourite “programs” was not working anymore on OS X 10.10. Homebrew, for those who don’t know it is “the missing package manager for OS X” and really saves a lot of time and trouble trying to install software on your mac system. It is like the ports collection from *BSD only for your Mac.

So are you like me, did the update to Yosemite and are now stuck with a non-working Homebrew? The fix is fairly simple. OSX 10.10 Yosemite comes with ruby 2.0 bundled and Homebrew is designed to work with ruby 1.8.x. So the only thing you have to do is:

  1. Open the file brew.rb using the following command: vi /usr/local/Library/brew.rb
  2. Change the first line from: #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0 to #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
  3. Save and exit brew.rb

Before you can do a “brew update” though you first have to commit your changes otherwise brew still does not work. Simply type in the following: cd $(brew –repository) && git commit -a -m ‘new ruby version 2.0′ and you are done. Happy updating your brew installation and continuing to work like you did before!

OSX 10.10下brew不能使用

似乎是10.10下默认Ruby版本已经2.0了,但是homebrew好像还在依赖1.8.7,所以目前brew属于瘫痪状态。

只要修改/usr/local/Library/brew.rb文件,第一行1.8改成2.0。

就可以正常运行了。

is not in the sudoers file 解决

解决方案:
首需要切换到root身份
$su –
(注意有- ,这和su是不同的,在用命令”su”的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用”su -“命令将环境变量也一起带过去,就象和root登录一样)

然后
$visudo     //切记,此处没有vi和sudo之间没有空格

1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL)  ALL
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)

这样就把自己加入了sudo组,可以使用sudo命令了。

Dropbox 旧版菜单

最新版本的 Dropbox 菜单不能直接”暂停同步”,也没有直接的”获取更多空间”按钮了,不过你可以按住 option 键点击 Dropbox 图标,就会显示旧版菜单。

iOS 7 主屏幕翻页另一法

你肯定知道在 iOS 的主屏幕上左右滑动手指即可翻页。其实还有个方法,点击 Dock 栏上边的空白区(也就是分页符”・”的左右两侧),也可以进行翻页,试试吧~

开启 OS X Mavericks 的”单应用”模式

“单应用”模式是 OS X 多年以来就支持的一个隐藏功能,它的作用就是当你用鼠标/触摸板在 Dock 上点击某应用程序之后,其他所有应用程序的窗口都会立刻隐藏(最小化),这样可以大大的避免你在某些应用上工作时被别的应用窗口分心,而且你的屏幕空间也不会被其他乱七八糟的窗口占据。
要开启”单应用”模式,必须运行一条终端命令即可生效:
defaults write com.apple.dock single-app -bool true && killall Dock

需要注意的是,单应用模式仅对你在 Dock 栏上切换应用程序有效,通过其他方式切换是无效的(比如 command+tab),大家试试就知道了。
要想回到正常模式,请运行命令:
defaults delete com.apple.dock single-app && killall Dock