Trying to Upgrade from Rails 1.2 to 2.1


#1

Hey, I’m trying to upgrade my rails projects that use engines to Rails
2.1.

Currently I am stuck at:
c:/dev/ruby/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:145:in
`ensure_all_registered_plugins_are_loaded!’: Could not locate the
following plugins: engines (LoadError)

There doesn’t seem to be any current or available documentation on how
to create your own plugin anymore.

I grabbed the code from github’s zip.

Here is a snip from my environment.rb:

automatically set the RAILS_APP variable from the dirname

RAILS_APP = File.basename(File.expand_path(File.dirname(’…’))) unless (
defined?(RAILS_APP) and !RAILS_APP.nil? and RAILS_APP != “”)

Bootstrap the Rails environment, frameworks, and default configuration

require File.join(File.dirname(FILE), ‘boot’)

require File.join(File.dirname(FILE),
‘…/…/…/…/vendor/plugins/engines/boot’)

Rails::Initializer.run do |config|
config.action_controller.session_store = :active_record_store

config.plugins = [“engines”, “extended_fragment_cache”, “interact”,

“*”]
end

Note: I have extra …/…/…/… in the engines boot line because all of
my environment.rb, boot.rb, and other config is located in my engine
plugin, using load/eval (and ability to override in the main config) so
every time something changes in Rails I just need to change it in one
place.

My engine plugin (interact) has the following init.rb:
require ‘interact’

require_dependency ‘interact’ # also tried this

What am I missing, or did something change in Rails Engines 2.X that
doesn’t like config files being relocated?

Thanks!


#2

Hmm, seems like my plugin’s environment.rb is getting called over and
over. Maybe there is some new magic that automatically loads plugin
environment.rb’s from engines/plugins? Doesn’t appear to even make it
to my \config\environment.rb anymore.


#3

Durr… Ignore me. I needed to update my plugin’s new boot.rb with the
additional …/…/… to get back up to the real RAILS_ROOT