ruby - Something wrong with active_record -
i got error when ran 'rackup' command after using rake database migrations, don't understand means.
c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/railties/databases.rake:3:in `<top (required)>': undefined method `namespace' main:object (nomethoderror) c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/sinatra-activerecord-2.0.6/lib/sinatra/activerecord/rake.rb:1:in `<top (required)>' c:/railsinstaller/ruby2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:69:in `require' c:/railsinstaller/ruby2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:69:in `require' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require' c:/wamp/www/sinatra-template-master/config.ru:2:in `block in <main>' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize' c:/wamp/www/sinatra-template-master/config.ru:in `new' c:/wamp/www/sinatra-template-master/config.ru:in `<main>' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:272:in `start' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/server.rb:147:in `start' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/bin/rackup:4:in `<top (required)>' c:/railsinstaller/ruby2.1.0/bin/rackup:23:in `load' c:/railsinstaller/ruby2.1.0/bin/rackup:23:in `<main>'
pls help, thanks!
i have in config.ru file
require './app' require 'sinatra/activerecord/rake' run sinatra::application
i tried same config.ru. when removed
require 'sinatra/activerecord/rake'
everything started work.
method "namespace" defined in rake/dsl_definition.rb. so, application extending sinatra::base doesn't see it.
Comments
Post a Comment