NoMethodError - undefined method `controllers' #2111

Closed
leemour opened this Issue Dec 23, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@leemour

leemour commented Dec 23, 2016

These steps reproduce the error:
padrino g project padrino -a sqlite -d activerecord -t rspec -e slim -c sass
cd ./padrino
bundle --binstubs
bundle exec padrino g admin -e slim
bundle exec rake db:migrate
bundle exec rake db:seed

Gemfile

ruby '2.3.3'
source 'https://rubygems.org'

gem 'padrino', '0.14.0.rc1', git: 'https://github.com/padrino/padrino-framework'

# Server requirements
gem 'puma'

# Project requirements
gem 'rake'

# Component requirements
gem 'activesupport', '>= 3.1'
gem 'bcrypt'
gem 'sass'
gem 'slim'
gem 'activerecord', '>= 3.1', :require => 'active_record'
gem 'sqlite3'

# Test requirements
group :test do
  gem 'rspec'
  gem 'rack-test', require: 'rack/test'
end

Full error stacktrace:

** Invoke db:seed (first_time)
** Invoke environment (first_time)
** Execute environment
  ERROR -  NoMethodError - undefined method `controllers' for Padrino::Admin:Module:
 /home/leemour/Ruby/padrino/admin/controllers/base.rb:1:in `<top (required)>'
rake aborted!
NoMethodError: undefined method `controllers' for Padrino::Admin:Module
/home/leemour/Ruby/padrino/admin/controllers/base.rb:1:in `<top (required)>'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/reloader.rb:96:in `block in safe_load'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/reloader.rb:309:in `with_silence'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/reloader.rb:96:in `safe_load'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/loader.rb:155:in `block in require_dependencies'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/loader.rb:153:in `each'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/loader.rb:153:in `require_dependencies'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/mounter/application_extension.rb:42:in `require_dependencies'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/mounter/application_extension.rb:34:in `block in setup_application!'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/mounter/application_extension.rb:47:in `trace_method'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/mounter/application_extension.rb:32:in `setup_application!'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/cli/rake_tasks.rb:7:in `block (2 levels) in <top (required)>'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/cli/rake_tasks.rb:6:in `each'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/bundler/gems/padrino-framework-624b006b7791/padrino-core/lib/padrino-core/cli/rake_tasks.rb:6:in `block in <top (required)>'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/leemour/.rbenv/versions/2.3.3/bin/rake:22:in `load'
/home/leemour/.rbenv/versions/2.3.3/bin/rake:22:in `<top (required)>'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:74:in `load'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:27:in `run'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:332:in `exec'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:20:in `dispatch'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:11:in `start'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/exe/bundle:34:in `block in <top (required)>'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/home/leemour/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/exe/bundle:26:in `<top (required)>'
/home/leemour/.rbenv/versions/2.3.3/bin/bundle:22:in `load'
/home/leemour/.rbenv/versions/2.3.3/bin/bundle:22:in `<main>'
Tasks: TOP => db:seed => environment

When I bundle exec padrino s without generating admin, it works. After there is at least 1 controller generated, I get this error.

@leemour leemour changed the title from NoMethodError - undefined method `controllers' for Padrino::Admin:Module to NoMethodError - undefined method `controllers' Dec 23, 2016

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Dec 25, 2016

Member

You should not name your project with the name of an existing constant. Fixed in 2ac1914

Member

ujifgc commented Dec 25, 2016

You should not name your project with the name of an existing constant. Fixed in 2ac1914

@ujifgc ujifgc closed this Dec 25, 2016

@ujifgc ujifgc referenced this issue Mar 15, 2017

Closed

Release 0.14.0 #1971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment