samedi 11 juin 2016

NameError: uninitialized constant Name in Sequel rails

I am just doing a simple operation. I created a new rails project and then a migration rails generate migration Saurabh. Now when I run rake db:migrate I get this error

rake aborted!
NameError: uninitialized constant Saurabh
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:261:in `const_get'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:261:in `block in constantize'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `each'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `inject'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `constantize'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:778:in `load_migration'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:773:in `migration'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:768:in `disable_ddl_transaction'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:1051:in `use_transaction?'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:961:in `rescue in block in migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:958:in `block in migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:in `each'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:in `migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:823:in `up'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:801:in `migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/rake-11.2.0/exe/rake:27:in `<top (required)>'
NameError: uninitialized constant Saurabh
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:261:in `const_get'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:261:in `block in constantize'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `each'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `inject'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `constantize'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:778:in `load_migration'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:773:in `migration'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:768:in `disable_ddl_transaction'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:1051:in `use_transaction?'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:1043:in `ddl_transaction'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:959:in `block in migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:in `each'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:in `migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:823:in `up'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/migration.rb:801:in `migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/home/saurabh/.rvm/gems/ruby-2.3.1/gems/rake-11.2.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I am new to Sequel. I made this changes in my rails project to work with Sequel instead of ActiveRecord. What am I missing in this simple operation?

Aucun commentaire:

Enregistrer un commentaire