ミームの死骸を待ちながら

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators. We, alone on earth, can rebel against the tyranny of the selfish replicators. - Richard Dawkins "Selfish Gene"

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators.
We, alone on earth, can rebel against the tyranny of the selfish replicators.
- Richard Dawkins "Selfish Gene"

こんぴゅたセンスない

.bash_profileでPATH通す

先日PATHの設定がわからなかったが
.bash_profile内に

export PATH=$PATH:/usr/local/bin:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man

と記述すればいい。port用と、localに入れたいろいろ用。

MySQLのあがき

$ sudo port install mysql5

した。rb-mysqlはまだ入れてない。しかしmysqlで実行できないのでどこにあるんかなと探す。mysql5フォルダが/opt/local/shareにあったのでfind mysqlしてみるがない。/opt/local/lib/mysql5/binの方か。

/opt/local/lib/mysql5/bin tak$ ./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)

よーわからん。設定が必要?

Ruby出来心

$ sudo port install ruby

してみたら(もうあるんだけど)、どこ入ったのかわからんかったorz時間かかったのに。/usr/bin下は相変わらず1.8.2だし…
あ、/opt/local/binにあった。libにライブラリ。結局二カ所に入れて無駄だった。アップデートしたかったのだが。

つまった

~/Project下でテスト用プロジェクト作ってWEBrick起動しようとしたら

$ rails Hoge
$ cd Hoge
$ ./script/server

Cannot find gem for Rails =1.1.6:
Install the missing gem with 'gem install -v=1.1.6 rails', or
change environment.rb to define RAILS_GEM_VERSION with your desired version.

えー。…言われた通りに

gem install -v=1.1.6 rails

を実行したら

Bulk updating Gem source index for: http://gems.rubyforge.org
Install required dependency rake? [Yn] Y

ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/lib/ruby/gems/1.8/cache/rake-0.7.1.gem

パーミッション変更しないとあかんのか?と思って覗いてみた

$ cd /usr/lib/ruby/gems/1.8/cache/
$ ls
sources-0.0.1.gem

ないやん。コマンド探してみた。

$ which rake
/usr/local/bin/rake

そこにあるんかい。どないしたらえんねん。

$ rake -v
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1822:in `load_rakefile'
(See full trace by running task with --trace)

$ rake --trace
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1822:in `load_rakefile'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1900:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
/usr/local/bin/rake:18:in `load'
/usr/local/bin/rake:18

次はhttp://rake.rubyforge.org/読んで試そう…。というかRailsなので

Everything needed to develop web-apps that can run on CGI, FastCGI, and mod_ruby.

FastCGIやmod_rubyがいる??早くAPIで遊びたいのに大学の息抜きどころかorzもういい、寝る。rake嫌い。