"NoMethodError: undefined method `type' for "character varying":String" after "rake db:migrate"
I tried to add check-ins to micro-posts but I've got an error after rake db:migrate.. What does it mean?
$ rake db:migrate --trace ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:migrate rake aborted! NoMethodError: undefined method `type' for "character varying":String
class AddCheckinToMicroposts < ActiveRecord::Migration def change add_column :microposts, :location, :point, :geographic => true end end
development: adapter: postgresql schema_search_path: public, postgis encoding: unicode database: blog_development host: localhost pool: 5 username: ******** password:
Assuming you are using the gem activerecord-postgis-adapter, you'd better try to change the database adapter to postgis as recommended in their official document:
the problem that you are having is that point method does not exist in ActiveRecord.
Instantiates a new column for the table. The type parameter is normally one of the migrations native types, which is one of the following: :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :time, :date, :binary, :boolean.
Hope this helps