ruby on rails - Schema dump with pre-existing MySQL database results in NoMethodError -
i've been trying schema dump new rails project using existing mysql database. here's setup in database.yml file:
default: &default adapter: mysql2 encoding: utf8 pool: 5 username: username_example password: password_example host: localhost socket: /tmp/mysql.sock development: <<: *default database: databasename
i added following gems gemfile , bundled:
gem 'mysql2' gem 'activerecord-mysql2-adapter'
after using command rake db:schema:dump
following error in schema file:
activerecord::schema.define(version: 0) # not dump table "tablename" because of following nomethoderror # undefined method `type' "text":string end
any ideas on how fix appreciated, thanks!
i discovered mysql version messing dump. removed activerecord mysql adaptor changed gemfile , dump worked perfectly:
gem 'mysql2', '~> 0.3.13'
Comments
Post a Comment