環境
- RVM on Ubuntu 12.04
準備
% ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
Ruby gemのアップグレード
% rvmsudo gem update --system % gem -v 1.8.24
Ruby on Railsのアップグレード
% rvm gemset use rails3 % rvmsudo gem update rails % rails -v Rails 3.2.6
bundlerが自動でアップデートされないので個別にアップデート。
% rvmsudo gem update bundler
既存のプロジェクトのアップデート
Gemfileの参考が欲しいので別にプロジェクトを生成。
% rails new app_326
既存のプロジェクトが app_323 以下にあるとする。Gemfileの内容を比較して更新する。
% diff app_323/Gemfile app_326/Gemfile % vi app_323/Gemfile
bundleでGemfileを最新にする。
% cd app_323 % rvmsudo bundle update
設定ファイルを最新版にする。以下のファイルが書き換えられるので注意。
config/boot.rb config/routes.rb config/application.rb config/environments/development.rb config/environments/production.rb config/environments/test.rb config/initializers/inflections.rb config/initializers/secret_token.rb config/initializers/session_store.rb config/locales/en.yml
設定ファイルを最新版にする。
% rake rails:update
各種変更
自分のソースに関係ありそうなやつだけ。
ActionPackの変更
- Deprecate :disable_with in favor of 'data-disable-with' option for button_to, button_tag and submit_tag helpers.
- Deprecate :confirm in favor of ':data => { :confirm => "Text" }' option for button_to, button_tag, image_submit_tag, link_to and submit_tag helpers.
- Added #beginning_of_hour and #end_of_hour to Time and DateTime core extensions.
Railtiesの変更
- Add hook for resource route's generator.
公開環境のpassengerアップグレード
Debian GNU/Linux Wheezyでの話。
% ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i486-linux] % gem1.9.3 --version 1.8.24 % rails -v Rails 3.2.6
passengerをアップデート。
% sudo gem1.9.3 update passenger
モジュール生成
% sudo passenger-install-apache2-module
バージョン情報を整える。/etc/apache2/mods-available/passenger.loadのpassengeのバージョン番号を修正。
LoadModule passenger_module /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
/etc/apache2/mods-available/passenger.confの中身のバージョン番号を修正。
PassengerRoot /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.13 PassengerRuby /usr/bin/ruby1.9.1
apacheを再起動する。
% sudo /etc/init.d/apache2 restart