怖話をRuby 1.9.3とRails 3.2.1にした。
アプリの動作には影響無く簡単に移行できると思いきや、shoulda-contextがrails 3.2から対応しないのでテストを全てRSpecに書き換えた。
rspecコマンド単体で実行した時とrake specした時で結果が違うのが少し気になるが・・・。
怖話をRuby 1.9.3とRails 3.2.1にした。
アプリの動作には影響無く簡単に移行できると思いきや、shoulda-contextがrails 3.2から対応しないのでテストを全てRSpecに書き換えた。
rspecコマンド単体で実行した時とrake specした時で結果が違うのが少し気になるが・・・。
PostgreSQLの調子で使ってたMySQLのtext型の最長を超えてるだけだった。
text: 65535Byte
mediumtext: 16777215Byte
longtext: 4294967295Byte
リゾートバイトは120KBぐらいの長編なのでmediumtextに変えて対応。
# RAILS_ROOT/db/migrate/20120127081325_alter_body_to_mediumtext_stories.rb
class AlterBodyToMediumtextStories < ActiveRecord::Migration
def up
if Rails.env.production?
execute 'ALTER TABLE stories MODIFY body mediumtext COLLATE utf8_unicode_ci;'
end
end
def down
if Rails.env.production?
execute 'ALTER TABLE stories MODIFY body text COLLATE utf8_unicode_ci;'
end
end
end
超えてもエラーが出ないから気づかなかったなあ。
This week in open source — giant robots smashing into other giant robots
We have officially stopped maintaining the following open source products: limerick_rake, trout, shoulda-context, and jester.
shoulda-contextが更新終了。怖話では全部コレでテスト書いてるのに。なんてこった!U2plusは混在してたのをRSpecに統一したところで調度良かったが・・・。
This week in open source — giant robots smashing into other giant robots
Hey! shoulda-context has a maintainer! His name is Travis Jeffery (travisjeffery) and he’s got commit rights and everything! Thank you, Travis.
なんて思ってたらメンテナが見つかって復活。もう何が何やら・・・。
Mac版VirtualboxでWindows XPを動かしてます。
現在10GBのディスクを16GBにしたい。
% VBoxManage modifyhd windows_xp_ie6-disk1.vmdk --resize 16000
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
not implemented yet・・・だと・・・?
新しいディスクを作って中身をコピーならできるので新しいディスク(今度は.vdi)を作成。
% VBoxManage clonehd windows_xp_ie6-disk1.vmdk NewHardDisk1.vdi --existing
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 0e01a2f9-eeb4-44a1-8a87-1ec508afbf9b
やったね。
これだけではWindows上に未割り当て領域が増えるだけなので「ディスクの管理」から拡張しようとしましたが、Windows XPではプライマリパーティションは拡張できない。(多分最近のWindowsはできる)
EaseUS Partition Master Homeというフリーソフトで簡単に出来ました。便利。
仮想化ソフト上だとバックアップして試すのが簡単なので安心してできますね。
Railsの設定ファイルを環境毎に書けるプラグインをいつも見失う。なんて名前だったっけ?
rails configとか検索し辛いワードなのでここに記す。(via @fakestarbabyさん)
railsjedi/rails_config - GitHub
SinatraやPadrinoに対応してるのにrails_configとは是如何に。
# config/deploy.rb
set :git_shallow_clone, 1
Added --depth 1
option to deploy command if use this setting.
$ defaults write NSGlobalDomain KeyRepeat -int 1
You need to reboot.
gemは問題無くできるものの、CIがエラー。
$ bundle exec rake
/home/vagrant/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem': rake is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from /home/vagrant/.rvm/gems/ruby-1.9.2-p290/bin/rake:18:in `'
Done. Build script exited with: 1
よく見ればちゃんと書いてある。
# gemspec:
s.add_development_dependency 'rake', '~> 0.9.2.2'
s.add_development_dependency 'rdoc', '~> 3.11'
Tracis-CIでrakeとrdoc使うからdevelopment_dependencyには入れとかなきゃいけない。