2008-09-01から1ヶ月間の記事一覧

[ruby] 普通のクラスでgettextを利用するには

railsの中で何もrailsのクラスを継承していないクラスでgettextを利用したい場合、以下の様に記述するとよい。 class Hoge include GetText bindtextdomain 'skip' # railsのApplicationControllerの init_gettext の引数と同じもの def fuga _('name') end …

[AIR][Ubuntu] Linux(Ubuntu)にAIRを入れてみる

以下からDLhttp://labs.adobe.com/downloads/air_linux.htmlダウンロードしたファイルに実行権限をつけて、実行する。 $ chmod u+x adobeair_linux_b1_091508.bin $ ./adobeair_linux_b1_091508.bin同意するを押すと、管理権限の確認ダイアログが表示される…

[rails] 続・Rails2.1.1は危ない

先日の日記(メモ)の解説 http://d.hatena.ne.jp/mat_aki/20080916/12215625512.1.1では、has_oneの関連で同時に保存した際に、関連テーブルのバリデーションの結果が親のインスタンスに保存されないようです。まず、2.1.0で実行する。 userの関連テーブル…

[rails] 2.1.1は危ないぞ!!

くわしくは、後で書く(と思う)。 /Users/mat/dev/skip% ./script/console -s Loading development environment in sandbox (Rails 2.1.0) Any modifications you make will be rolled back on exit >> u = User.new_with_identity_url('hoge.hoge',{:email…

Mac OS Xにgemのmysqlをインストール

http://d.hatena.ne.jp/kurusaki/20080716/p1 このひとと同じエラーが発生した。そして、このひとの解決方法を試したが以下のエラー /opt/local/bin/ruby extconf.rb install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config extconf.rb:1:…