Redis

MacにRedisさんをインストールする

More than 5 years have passed since last update.

memcachedよりよさそうなKVSのRedisをHomebrewを使ってインストールする。

$ brew update

$ brew install redis

Error: Failed executing: make -C src 

If `brew doctor' does not help diagnose the issue, please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue

エラー出て、brew doctor で調べてって言われた。

$ brew doctor redis

We couldn't detect gcc 4.2.x. Some formulae require this compiler.

NOTE: Versions of XCode newer than 4.2 don't include gcc 4.2.x.

==> /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. This is an issue if you eg. brew installed Python.

Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your PATH.
Some "config" scripts were found in your path, but not in system or Homebrew folders.

`./configure` scripts often look for *-config scripts to determine if software packages
are installed, and what additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if
the config script overrides a system or Homebrew provided script of the same name.

/Applications/MAMP/Library/bin
curl-config freetype-config libmcrypt-config libpng-config libpng15-config sablot-config xml2-config xslt-config yaz-config

/usr/local/bin を /usr/bin より前にしてって言われたので、.bashrc で $PATH の順番を変更。

$ brew install redis

==> Downloading http://redis.googlecode.com/files/redis-2.4.6.tar.gz

File already downloaded in /Users/suin/Library/Caches/Homebrew
==> make -C src
==> Caveats
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/redis/2.4.6/io.redis.redis-server.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist

If this is an upgrade and you already have the io.redis.redis-server.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/io.redis.redis-server.plist
cp /usr/local/Cellar/redis/2.4.6/io.redis.redis-server.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist

To start redis manually:
redis-server /usr/local/etc/redis.conf

To access the server:
redis-cli
==> Summary
/usr/local/Cellar/redis/2.4.6: 9 files, 460K, built in 3 seconds

できた