Your config/boot.rb is outdated: Run "rake rails:update".

Railsのバージョンを上げるとアプリケーションが起動しなくなってから
そのままになっているので再挑戦してみる。
先週までの状況はここ

Railsのアプリケーションを起動時のエラー

=> Booting WEBrick...
Your config/boot.rb is outdated: Run "rake rails:update".

エラーメッセージのとおりにrake rails:updateを実行するとエラー

rake rails:updateを実行すると下記のようなエラーになってしまう。

Kuru-MacBook:skp001 kuru$ rake rails:update
(in /Users/kuru/01_Projects/saikaiproject/skp001)
rake aborted!
undefined method `last' for {}:Hash
/Users/kuru/01_Projects/saikaiproject/skp001/rakefile:10
(See full trace by running task with --trace)

このときのrakefileの内容

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'

新規にプロジェクトを作成し実行してみる

Railsの古いバージョンで作成したアプリケーションが動作しないので
試しに新規でプロジェクトを作成してみる。

開発環境

Rails Projectを作成し、新規に作成したプロジェクトのServer propertiesを見るとTypeがMongrelになっているので
既存のプロジェクトと合わせてTypeをWEBrickに変更する。
Eclipseで新規に作成したプロジェクトのserverを起動すると正常に起動できる。
新規に作成したプロジェクトは問題なく起動するので環境に問題はなさそうだ。

試しにboot.rbを書き換えてみる。

試しに既存のプロジェクトのconfig/boot.rbを新規で作成したプロジェクトのboot.rbで上書きしてサーバーを起動してみる。
状況は変わり下記のようなエラーになった。

"2453"
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.1.0 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...

      *******************************************************************
      * config.breakpoint_server has been deprecated and has no effect. *
      *******************************************************************
      
/Users/kuru/01_Projects/saikaiproject/skp001/vendor/plugins/engines/init.rb:4:in `evaluate_init_rb'Exiting
: This version of the engines plugin requires Rails 1.2 or later! (RuntimeError)
	from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/rails/plugin.rb:95:in `evaluate_init_rb'
	from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
	from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/rails/plugin.rb:91:in `evaluate_init_rb'
	from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/rails/plugin.rb:44:in `load'
	from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:33:in `load_plugins'
	from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:32:in `each'
	from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:32:in `load_plugins'
	from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/initializer.rb:283:in `load_plugins'
	 ... 32 levels...
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
	from ./script/server:3
	from -e:2:in `load'
	from -e:2

Enginesプラグインのinit.rbでエラーになっているようだ。
既存のアプリケーションにインストールしているEnginesプラグインは1.2で
アプリケーションではLoginEngineを使用している。
認証関連はacts_as_authenticatedに変更しょうかと考えていたがRadRailsRails PluginsでEnginesを確認するとバージョンが3.4になっている。

取りあえず、Enginesをバージョンアップして試してみる。

Enginesをインストールする。

Enginesプラグインをインストール

RadRailsRails PluginsでEnginesを選択し、Installラジオボタンを選択しGoボタンを押下する。

Consoleに下記のメッセージが表示される。
already installed: engines (http://svn.rails-engines.org/plugins/engines).  pass --force to reinstall

一度、削除してから再インストールしないとダメなのか

Enginesプラグインを削除

Removeラジオボタンを選択しGoボタンを押下する。

vendor/pluginsからenginesが削除された。

Enginesプラグインをインストール

Installラジオボタンを選択しGoボタンを押下する。

この時のConsoleの表示

+ ./CHANGELOG
+ ./MIT-LICENSE
+ ./README
+ ./Rakefile
+ ./about.yml
+ ./boot.rb
+ ./generators/plugin_migration/USAGE
+ ./generators/plugin_migration/plugin_migration_generator.rb
+ ./generators/plugin_migration/templates/plugin_migration.erb
+ ./init.rb
+ ./lib/engines/assets.rb
+ ./lib/engines/plugin/list.rb
+ ./lib/engines/plugin/loader.rb
+ ./lib/engines/plugin/locator.rb
+ ./lib/engines/plugin/migrator.rb
+ ./lib/engines/plugin.rb
+ ./lib/engines/rails_extensions/action_mailer.rb
+ ./lib/engines/rails_extensions/asset_helpers.rb
+ ./lib/engines/rails_extensions/dependencies.rb
+ ./lib/engines/rails_extensions/migrations.rb
+ ./lib/engines/rails_extensions/rails.rb
+ ./lib/engines/rails_extensions/routing.rb
+ ./lib/engines/testing.rb
+ ./lib/engines.rb
+ ./tasks/engines.rake
+ ./test/app/controllers/app_and_plugin_controller.rb
+ ./test/app/controllers/application.rb
+ ./test/app/controllers/namespace/app_and_plugin_controller.rb
+ ./test/app/helpers/mail_helper.rb
+ ./test/app/models/app_and_plugin_model.rb
+ ./test/app/models/notify_mail.rb
+ ./test/app/things/thing.rb
+ ./test/app/views/app_and_plugin/a_view.html.erb
+ ./test/app/views/namespace/app_and_plugin/a_view.html.erb
+ ./test/app/views/notify_mail/implicit_multipart.text.html.erb
+ ./test/app/views/notify_mail/implicit_multipart.text.plain.erb
+ ./test/app/views/notify_mail/multipart_html.html.erb
+ ./test/app/views/notify_mail/multipart_plain.html.erb
+ ./test/app/views/notify_mail/signup.text.plain.erb
+ ./test/app/views/plugin_mail/mail_from_plugin_with_application_template.text.plain.erb
+ ./test/app/views/plugin_mail/multipart_from_plugin_with_application_template_plain.html.erb
+ ./test/functional/controller_loading_test.rb
+ ./test/functional/routes_test.rb
+ ./test/functional/view_helpers_test.rb
+ ./test/functional/view_loading_test.rb
+ ./test/lib/app_and_plugin_lib_model.rb
+ ./test/lib/engines_test_helper.rb
+ ./test/plugins/alpha_plugin/app/controllers/alpha_plugin_controller.rb
+ ./test/plugins/alpha_plugin/app/controllers/app_and_plugin_controller.rb
+ ./test/plugins/alpha_plugin/app/controllers/namespace/alpha_plugin_controller.rb
+ ./test/plugins/alpha_plugin/app/controllers/namespace/app_and_plugin_controller.rb
+ ./test/plugins/alpha_plugin/app/controllers/namespace/shared_plugin_controller.rb
+ ./test/plugins/alpha_plugin/app/controllers/shared_plugin_controller.rb
+ ./test/plugins/alpha_plugin/app/models/alpha_plugin_model.rb
+ ./test/plugins/alpha_plugin/app/models/app_and_plugin_model.rb
+ ./test/plugins/alpha_plugin/app/models/shared_plugin_model.rb
+ ./test/plugins/alpha_plugin/app/views/alpha_plugin/a_view.html.erb
+ ./test/plugins/alpha_plugin/app/views/app_and_plugin/a_view.html.erb
+ ./test/plugins/alpha_plugin/app/views/layouts/plugin_layout.erb
+ ./test/plugins/alpha_plugin/app/views/namespace/alpha_plugin/a_view.html.erb
+ ./test/plugins/alpha_plugin/app/views/namespace/app_and_plugin/a_view.html.erb
+ ./test/plugins/alpha_plugin/app/views/namespace/shared_plugin/a_view.html.erb
+ ./test/plugins/alpha_plugin/app/views/shared_plugin/a_view.html.erb
+ ./test/plugins/alpha_plugin/lib/alpha_plugin_lib_model.rb
+ ./test/plugins/alpha_plugin/lib/app_and_plugin_lib_model.rb
+ ./test/plugins/beta_plugin/app/controllers/app_and_plugin_controller.rb
+ ./test/plugins/beta_plugin/app/controllers/namespace/shared_plugin_controller.rb
+ ./test/plugins/beta_plugin/app/controllers/shared_plugin_controller.rb
+ ./test/plugins/beta_plugin/app/models/shared_plugin_model.rb
+ ./test/plugins/beta_plugin/app/views/namespace/shared_plugin/a_view.html.erb
+ ./test/plugins/beta_plugin/app/views/shared_plugin/a_view.html.erb
+ ./test/plugins/beta_plugin/init.rb
+ ./test/plugins/not_a_plugin/public/should_not_be_copied.txt
+ ./test/plugins/test_assets/app/controllers/assets_controller.rb
+ ./test/plugins/test_assets/app/views/assets/index.html.erb
+ ./test/plugins/test_assets/app/views/layouts/assets.html.erb
+ ./test/plugins/test_assets/init.rb
+ ./test/plugins/test_assets/public/file.txt
+ ./test/plugins/test_assets/public/subfolder/file_in_subfolder.txt
+ ./test/plugins/test_assets_with_assets_directory/assets/file.txt
+ ./test/plugins/test_assets_with_assets_directory/assets/subfolder/file_in_subfolder.txt
+ ./test/plugins/test_assets_with_assets_directory/init.rb
+ ./test/plugins/test_assets_with_no_subdirectory/assets/file.txt
+ ./test/plugins/test_assets_with_no_subdirectory/init.rb
+ ./test/plugins/test_code_mixing/app/things/thing.rb
+ ./test/plugins/test_code_mixing/init.rb
+ ./test/plugins/test_load_path/init.rb
+ ./test/plugins/test_migration/db/migrate/001_create_tests.rb
+ ./test/plugins/test_migration/db/migrate/002_create_others.rb
+ ./test/plugins/test_migration/init.rb
+ ./test/plugins/test_plugin_mailing/app/models/plugin_mail.rb
+ ./test/plugins/test_plugin_mailing/app/views/plugin_mail/mail_from_plugin.text.plain.erb
+ ./test/plugins/test_plugin_mailing/app/views/plugin_mail/multipart_from_plugin_html.html.erb
+ ./test/plugins/test_plugin_mailing/app/views/plugin_mail/multipart_from_plugin_plain.html.erb
+ ./test/plugins/test_plugin_mailing/app/views/plugin_mail/multipart_from_plugin_with_application_template_html.html.erb
+ ./test/plugins/test_plugin_mailing/app/views/plugin_mail/multipart_from_plugin_with_application_template_plain.html.erb
+ ./test/plugins/test_plugin_mailing/init.rb
+ ./test/plugins/test_routing/app/controllers/namespace/test_routing_controller.rb
+ ./test/plugins/test_routing/app/controllers/test_routing_controller.rb
+ ./test/plugins/test_routing/init.rb
+ ./test/plugins/test_routing/routes.rb
+ ./test/plugins/test_testing/init.rb
+ ./test/plugins/test_testing/test/fixtures/testing_fixtures.yml
+ ./test/unit/action_mailer_test.rb
+ ./test/unit/arbitrary_code_mixing_test.rb
+ ./test/unit/assets_test.rb
+ ./test/unit/backwards_compat_test.rb
+ ./test/unit/load_path_test.rb
+ ./test/unit/migration_test.rb
+ ./test/unit/model_and_lib_test.rb
+ ./test/unit/plugins_test.rb
+ ./test/unit/testing_test.rb

vendor/pluginsにenginesがインストールされた。

ここで試しにサーバーを起動してみる。

試しにサーバーを起動してみると下記のエラーになる。

"2777"
=> Booting WEBrick...
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- /Users/kuru/01_Projects/saikaiproject/skp001/vendor/plugins/engines/lib/engines/deprecated_config_support (MissingSourceFile)
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
	from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
	from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
	from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
	from /Users/kuru/01_Projects/saikaiproject/skp001/config/environment.rb:13
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
	from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
	 ... 10 levels...
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
	from ./script/server:3
	from -e:2:in `load'
	from -e:2