&tag(Rails4/アップグレード);
*目次 [#gf30637e]
#contents
*関連ページ [#z594aaf6]
-[[Rails3/アップグレード]]
-[[Rails4]]

*参考情報 [#e1875784]
-[[Ruby on Rails Guides:http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html]] // アップグレードに関する公式情報
*Rails 4.0 -> Rails 4.1 [#ff44893b]
**手順 [#ya772ee6]
-Gemfileの編集
 gem 'rails', '4.1.1'
-bundle実行
 bundle update
-railsをアップデート
 bundle exec rake rails:update
-conflictした設定ファイルをgit diffしながら修正していく

**トラブルシューティング [#f667959f]
***bootstrap_flashが表示されない [#pa5de825]
-https://github.com/seyhunak/twitter-bootstrap-rails/issues/721 の問題か。

***No route matches [PATCH] [#v7c57453]
-routes.rbの定義で、put〜となっているのを、patch〜に修正する。
*Rails3.2 ->Rails4.0 [#qe656256]
**参考情報 [#r3ae4013]
-[[Rails3.2 -> Rails4.0 アップグレード - 130単位:http://d.hatena.ne.jp/deeeki/20131124/upgrade_to_rails4]]
-[[Rails3.2 to Rails4 アップデートしてみた - Qiita:http://qiita.com/konpyu/items/0420679deb402897fc0a]]
-[[Rails 4.0 にアップグレードした - @m4i's blog:http://blog.m4i.jp/entry/2013/12/10/184336]]
-[[#415 Upgrading to Rails 4 - RailsCasts:http://railscasts.com/episodes/415-upgrading-to-rails-4?language=ja&view=asciicast]]

**手順 [#c91f51f0]
-Gemfileの編集
 gem 'rails', '4.0.5'
-bundle実行
 bundle update
-railsのバージョンを最新に変更
 bundle exec rake rails:update
-conflictした設定ファイルをgit diffしながら修正していく

**ソースコードの修正 [#a9895b60]
-http://guides.rubyonrails.org/upgrading_ruby_on_rails.htmlより、
-:confirmは、 data: { confirm: 'Are you sure?' }のように修正する。
**Gemのアップデート [#xf022673]
***simple-captchaのアップデート [#n1b4f921]
-[[pludoni/simple-captcha:https://github.com/pludoni/simple-captcha]]を使う。

***act_as_paranoidのアップデート [#a2ceb9c8]
-[[Rails4と3で論理削除を行うためのGem Kakurenbo の紹介と今更論理削除Gemを実装した理由。 - 波打際のブログさん:http://alfa.hatenablog.jp/entry/2014/01/26/225852]]か、Paranoiaを使う。




**トラブルシューティング [#g98f720b]
***You should not use the `match` methodのエラーが発生 [#aa5b86fb]
-[[Rails4で「You should not use the `match` method〜」のRuntimeError - Qiita:http://qiita.com/ytr_i/items/af3c75bb88be59de804d]]にあるように、routes.rbでmatchをgetに変更する。
***Pending Migrationで実行できない [#id226ff1]
-[[ruby on rails - How do you skip failed migrations? (rake db:migrate) - Stack Overflow:http://stackoverflow.com/questions/8810732/how-do-you-skip-failed-migrations-rake-dbmigrate]]
-db/migrate/99999999999999_XXXX.rbがあるのが原因。以下を実行する(数字の場合は、実際のバージョン名にあわせる)。
 insert into schema_migrations (version) values ('99999999999999');
-[[postgresql - How to skip rails migrations after creating database from dump - Stack Overflow:http://stackoverflow.com/questions/10580928/how-to-skip-rails-migrations-after-creating-database-from-dump]]

***kaminari+twitter-bootstrapの表示がみだれる [#b53ae9ee]
***ajaxがうまく動かない? [#ud046185]


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS