Error "Undefined method 'middleware' for ActionController" When Running 'ruby script/generate plugin_migration'

41 views
Skip to first unread message

SS

unread,
Aug 24, 2009, 7:08:04 PM8/24/09
to CommunityEngine
Hello,
I'm trying to setup Community Engine to work with my code, however
after installing all the required gems and following the steps as
described on http://github.com/bborn/communityengine/tree/master I
still can't run 'ruby script/generate plugin_migration' command. It
gives me the following error message:


C:/mywork/vendor/plugins/community_engine/config/initializers/
sessions_middleware.rb:1: undefined method `middleware' for
ActionController::Dispatcher:Class (NoMethodError)
from C:/mywork/vendor/rails/activesupport/lib/active_support/
dependencies.rb:142:in `load_without_new_constant_marking'
from C:/mywork/vendor/rails/activesupport/lib/active_support/
dependencies.rb:142:in `load_without_desert'
from C:/mywork/vendor/rails/activesupport/lib/active_support/
dependencies.rb:521:in `new_constants_in'
from C:/mywork/vendor/rails/activesupport/lib/active_support/
dependencies.rb:142:in `load_without_desert'
from C:/Ruby/lib/ruby/gems/1.8/gems/desert-0.5.0/lib/desert/
ruby/object.rb:18:in `load'
from C:/Ruby/lib/ruby/gems/1.8/gems/desert-0.5.0/lib/desert/
ruby/object.rb:32:in `__each_matching_file'
from C:/Ruby/lib/ruby/gems/1.8/gems/desert-0.5.0/lib/desert/
ruby/object.rb:17:in `load'
from C:/mywork/vendor/plugins/community_engine/config/boot.rb:
5
... 13 levels...
from C:/mywork/vendor/rails/railties/lib/commands/generate.rb:
1
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from script/generate:3

Am I missing to add a required library in my environment.rb file? So
far I've added:
require 'desert'
---
config.plugins = [:community_engine, :white_list, :all]
config.plugin_paths += ["#{RAILS_ROOT}/vendor/plugins/
community_engine/plugins"]

config.action_controller.session = {
:key => 'appsession',
:secret => '123454'
}
---
require "#{RAILS_ROOT}/vendor/plugins/community_engine/config/boot.rb"


I did a research online and I didn't find anyone having the same
problem, does that mean everyone got it working by just following the
steps outlined in the official git website?

Please help.

I'll really appreciate your help!
Siyan

SS

unread,
Aug 26, 2009, 4:08:51 PM8/26/09
to CommunityEngine
I found out what the problem was. I was running Rails 2.2.2 version. I
upgraded to 2.3.3 and now it works better. Still looking as to why I
can't run 'script/generate plugin_migration' command. I keep getting
error:

"'script' is not recognized as an internal or external command,
operable program or batch file."

I tried running 'ruby script/generate plugin_migration' and I get
message:

"---
[COMMUNITY ENGINE] You have 62 pending CommunityEngine migrations:
CE is at 62, but you have only migrated it to 0
Please run 'script/generate plugin_migration' AND 'rake db:migrate'
before continuing, or you will experience errors.
---
exists db/migrate
create db/migrate/
20090826195748_community_engine_to_version_62.rb"


--------------------------
Where I can't run 'script/generate plugin_migration'. If someone knows
how to run the plugin_migration please let me know. I'm running it
from my work root directory.

Regards,
Siyan

SS

unread,
Aug 26, 2009, 4:29:37 PM8/26/09
to CommunityEngine
Looks like I was good to go. I ran the 'rake db:migrate' and created
the required tables in my dev environment.

Yay!
Reply all
Reply to author
Forward
0 new messages