Windows ツール集
Windows ツール集というのを作ってみました。Windows に最初から入っている、もしくは Microsoft が配布しているツールになります。 便利なものがたくさんあるので有効に使ってみたいところです。
名探偵コナンの感想、モータースポーツがらみの話題、FreeBSD、インターネットの雑記、sb のプラグインなどがあります。
$ tar zxvf ruby-postgres-*.tar.gzで大丈夫です。
$ ruby extconf.rb --with-pgsql-dir=/usr/local/pgsql
gem install ruby-postgresとして、さらに libpq.dll にアクセスできるようにするために環境変数の PATH に
今までの値;C:\Program Files\PostgreSQL\8.1\binを追加します。
$hoge = "abcdefg";
$hoge =~ m/c(def)/;
if($hoge =~ m/(ho)ge/){
print "nocode\n";
}
else{
print $1 , "\n";
}とすると最初のマッチ結果のdefが出力されます。$hoge = "abcdefg"
$hoge =~ /c(def)/
if $hoge =~ /(ho)ge/
print "nocode\n"
else
print $1 + "\n"
endとすると if 文内のマッチ結果がなかったことを示すnilが出力されます。微妙な違いですが perl 使いの人は気をつけましょう。./configure --with-openssl -with-includes=/usr/kerberos/include --enable-multibyte=UNICODE --enable-syslog --with-java --with-perlUNICODE は EUC_JP でもOKです。後は、
make
su
make install
adduser postgresでOK
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su -l postgres
cd /usr/local/pgsql/data
openssl req -new -text -out server.req
openssl rsa -in privkey.pem -out server.key
rm privkey.pem
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod og-rwx server.key
export PATH=/usr/local/pgsql/bin:${PATH}
initdb -D /usr/local/pgsql/data
pg_ctl -D /usr/local/pgsql/data -l logfile start
createuser foo
createdb -E EUC_JP sampledb
psql -U foo sampledb
ALTER USER postgres WITH ENCRYPTED PASSWORD 'passwd';
gem install rails --include-dependenciesでよくて、ruby の postgres ライブラリは
gem install ruby-postgres --include-dependenciesとコマンドプロンプトに打ち込むだけでインストールできる。これは便利だ。
rake
activesupport
activerecord
actionpack
actionmailer
actionwebservice