• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

This article was migrated from http://rails.office.drecom.jp/hibi/archive/18

仕事しながら、サッカーを楽しみます。
しかし日本、しょうもない負けっぷり。
ASCIIのも面白そうなのだけど、サーバがいっぱいでログインできなかった。。。残念。

footiefox:
ゴールが決まると歓声だけが上がります 笑。それが割りと楽しい。
生中継見てるみたいで面白い。
Firefoxエクステンションです。
http://palmlife.exblog.jp/4917809

ASCIIアートでサッカーを生中継:
http://http://ascii-wm.net/

二つとも http://reddit.com/ 経由。 http://rails.office.drecom.jp/hibi/archive/18

This article was migrated from http://rails.office.drecom.jp/hibi/archive/18

posted by Png satoko on Wed 14 Jun 2006 at 05:53 with 2 comments

This article was migrated from http://rails.office.drecom.jp/hibi/archive/17

小生、栗東というところに住んでいるのでなかなか外の人(いや社内の人も)会う機会がないのだけど、この間たまたま出張で恵比寿のオフィスに行ったら、親睦会なる飲み会があってそれにまぜてもらえました。

そこに来られたのが、たたみラボの石橋さん。
http://iandeth.dyndns.org/mt/ian/


明るいお兄さんです。しかもリクルートなのになぜかwindowsロゴのTシャツ。


rubyしたことないです。やってみたいけど時間ない。。


普段はperl一色。


たたみラボは16畳くらいのほんとに畳の部屋にあるです。


たたみラボのPVを増やすために日夜励んでるです。


3人がごにょごにょ、3人がごにょごにょ、開発がごにょごにょ
といううそかほんとかわからないような話も聞けました。

こういう飲み会楽しいですねぇ。
栗東に住んでたらこんなことできないわぁ。

石橋さんー、こんばんわ。
この間はどうもです!楽しかったです♪
勝手に登場してもらっちゃいました、ゴメンナサイ。 http://rails.office.drecom.jp/hibi/archive/17

This article was migrated from http://rails.office.drecom.jp/hibi/archive/17

posted by Png satoko on Sun 11 Jun 2006 at 01:10

This article was migrated from http://rails.office.drecom.jp/hibi/archive/16

おととい見つけました。
前確かベータだったよね。多分。
しかもmassageうけてました、彼ら。
ガンマからどんな成長をとげるのか、楽しみです。

http://rails.office.drecom.jp/hibi/archive/16

This article was migrated from http://rails.office.drecom.jp/hibi/archive/16

posted by Png satoko on Sat 10 Jun 2006 at 01:20

This article was migrated from http://rails.office.drecom.jp/hibi/archive/15

永久って書き方がすごいですが。

アプリを動かしてると、

"Illegal mix of collations
(latin1_swedish_ci,IMPLICIT) and
(sjis_japanese_ci,COERCIBLE) for operation '='"

みたいなエラーが出て。文字コードはUTF8とswedishなんたらだったけど。
したら、take another stepさんが対決してはった。
http://dream.ie.ariake-nct.ac.jp/~naoyuki/archives/000041.php

つまり、サーバとクライアントのコードが違うということらしいです。
ふむ。

mysqlのリファレンスを調べる。したらコレ。
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

SET NAMES 'x'

としたらいいらしい。
でもこれだとアプリで毎回しなくちゃいけないし。
大体rubyでどうするのかよくわからない。

そしたら!
先のmysqlのリファレンスのしたーーーのほうに
N Bernhardtさんがコメント。
--------------------------------------------------
Posted by N Bernhardt on August 17 2005 4:51pm

To change the connection charset permanently to UTF-8, add the following line in the [mysqld] section:
[mysqld]
init-connect='SET NAMES utf8'
--------------------------------------------------

で、/etc/mysql/my.cnfの[mysqld]のところにinit-…を追加しました。
show variables like 'character%';
show variables like 'collationr%';
してもやっぱり変数の値は変わってないですが、アプリを起動すると…
あら不思議!ちゃんと動きました!

(ただこれするとほかのアプリとかでUTF8にしたくないときも
UTF8になるので注意って書いてありました。なので注意です。)

とにかくやったーーー!
いやもうなんでも初心者で大変です。 http://rails.office.drecom.jp/hibi/archive/15

This article was migrated from http://rails.office.drecom.jp/hibi/archive/15

posted by Png satoko on Mon 5 Jun 2006 at 15:37

This article was migrated from http://rails.office.drecom.jp/hibi/archive/14

winのとよく似てます。

database.ymlのproductionのDB接続を編集

環境変数RAILS_ENVをセット。
export RAILS_ENV=production

script/aboutで確認
サービススタート!
lighttpd start -f lighttpd.myapp.conf -D

これでおっけー!
なんかあっけなかった。。。 http://rails.office.drecom.jp/hibi/archive/14

This article was migrated from http://rails.office.drecom.jp/hibi/archive/14

posted by Png satoko on Mon 5 Jun 2006 at 15:21

This article was migrated from http://rails.office.drecom.jp/hibi/archive/13

すごいタイトルだね、これ。

winでproductionを試そうとしていたら、新井さんがVMWareを教えてくれた。
DebianもDBもRubyもいっぱい入ってお得なvmxももらう♪
なのでwinでproductionは頓挫。

ででlighttpd入ってなさそうなので、入れてみることにする。
--------------------------------------------------
参考:
http://wota.jp/ac/?date=20051113#p04
http://d.hatena.ne.jp/secondlife/20050406/1112719612
http://d.hatena.ne.jp/moro/20060130/1138628101
http://www.kharakawa.com/kh.log/archives/2006/01/lighttpd_fastcgi_rails.html
--------------------------------------------------
■lighttpdインストール
くまくまさんのを参考に。
/etc/apt/source.listに下記を追加
deb http://debian.bougyman.com unstable main

# aptitude update
# aptitude update
# aptitude install lighttpd
なんか途中でインストールするかといってくるけど、Yでリターン

■lighttpd.conf
でで、secondlifeさんのを参考に。
lighttpd.rails.confを作って起動するが、
RailsFCGIHanderが見つからないみたいなエラーが出るので 汗汗。
どうやら、dispatch.fcgiでrequire 'fcgi_handler'ができてないみたい。
でやとこさ、FCGIをインストールしてないことに気づく。

■FastCGIをインストール
kh.logさんのを参考に。
先に追加したsource.listのhttp://debian.bougyman.comの行を削除して、
aptitude update
aptitude instal libfcgi-ruby libfcgi-ruby1.8
で、これもインストールするかって聞いてくるのでYでリターン。

ちなみに、そこで紹介されてたlighttpdのURLではinstallできなかった。。。なんでかな。
URLが有効でなさそう。その辺が素人には大変です。

■Lighttpd開始・停止
下記で起動してエラーが出てないかみます。Ctrl+Cでstopできるみたい。
lighttpd start -f lighttpd.rails.conf -D

-Dつけないときはkill -term PIDで停止。

で、早速アクセス!
動いたーーーー!!!

でも一部動いてない。。。なんでだ。winでは動いてたのに。
エラーも出てなさそう。

明日はとりあえずproductioinをやろう。修正はその後だにゃ。
--------------------------------------------------
PS secondlifeさんが書かれていた、

次にpublic/dispatch.fcgiの二行目あたりに、
RAILS_ROOT = ENV['RAILS_ROOT']
を追加して


というくだりがあるのですが、これはなんで必要なのかなぁ。。。
よくわからないにゃ。
どなたか教えてくださいませませ。 http://rails.office.drecom.jp/hibi/archive/13

This article was migrated from http://rails.office.drecom.jp/hibi/archive/13

posted by Png satoko on Sun 4 Jun 2006 at 03:47

This article was migrated from http://rails.office.drecom.jp/hibi/archive/12

公開するのはUNIX系だろうけど、自分の環境はwinなので。
とりあえずwinでproductionにしてみる。
bestな方法ではないので、その辺ご了承くださいませ。

まずは、コレを見てみる。


P462を見る。
各Webサーバによってproductionの指定が違うみたい。
お手軽にWEBrickでやるとき。コマンドプロンプトで。

C:\Program Files\ruby\rails_apps\your_app>set rails_env=production
C:\Program Files\ruby\rails_apps\your_app>ruby script\server --environment=production

としたらおっけー!
へぇ、まじで!簡単だ。
あ、もちろん、database.ymlでproductionのDBを設定しとくの忘れないでね。

で、productionにしたらscript\aboutコマンドで本当にproductionになっているか確認しとくといいかも。下記は前の記事のとコピペしてます。

C:\Program Files\ruby\rails_apps\your_app>ruby script\about
About your application's environment
Ruby version 1.8.2 (i386-mswin32)
RubyGems version 0.8.10
Rails version 1.1.2
Active Record version 1.14.2
Action Pack version 1.12.1
Action Web Service version 1.1.2
Action Mailer version 1.2.1
Active Support version 1.3.1
Edge Rails revision 4393
Application root C:/Program Files/ruby/rails_apps/your_app
Environment production
Database adapter mysql
Database schema version 2

本当にproduction環境にするにはWebサーバとかDBとかAPPサーバとかその辺の設定をチューニングする必要ありだろうけど、その辺はほかの人においておいちゃおう。
http://rails.office.drecom.jp/hibi/archive/12

This article was migrated from http://rails.office.drecom.jp/hibi/archive/12

posted by Png satoko on Thu 1 Jun 2006 at 15:32

This article was migrated from http://rails.office.drecom.jp/hibi/archive/11

前の記事の挑戦の確認。
こんな感じでEdgeで動いてるのが確認できるみたいです。

C:\Program Files\ruby\rails_apps\your_app>ruby script\about
About your application's environment
Ruby version 1.8.2 (i386-mswin32)
RubyGems version 0.8.10
Rails version 1.1.2
Active Record version 1.14.2
Action Pack version 1.12.1
Action Web Service version 1.1.2
Action Mailer version 1.2.1
Active Support version 1.3.1
Edge Rails revision 4393
Application root C:/Program Files/ruby/rails_apps/your_app
Environment production
Database adapter mysql
Database schema version 2 http://rails.office.drecom.jp/hibi/archive/11

This article was migrated from http://rails.office.drecom.jp/hibi/archive/11

posted by Png satoko on Thu 1 Jun 2006 at 15:22