2

I have a Rails(4.1.0) app that works fine on Heroku. However, on my local machine, rake db:migrate fails due to a table for devise that uses inet datatype and I am using sqlite3 for testing.

I have included the postgres gem as well as postgres_ext but still coming up with the error:

undefined method `inet' for #<ActiveRecord::ConnectionAdapters::Table:0x00000005fae9e8>/home/app/db/migrate/20141107192501_add_devise_to_users.rb:19:in `block in up'
6
  • What is the offending devise module? Commented Nov 12, 2014 at 2:52
  • Trackable, when it tries to create the table columns for current_sign_in_ip and last_sign_in_ip. Both of which are type inet. Commented Nov 12, 2014 at 2:58
  • Is using Postgres locally an option? Commented Nov 12, 2014 at 3:01
  • It is, and I have postgres 9.3 installed. I added pg gem for dev environment but still getting the same issue. I feel there's something here I'm missing entirely. Commented Nov 12, 2014 at 3:09
  • 1
    Do you have Postgres set up in your database.yml? Commented Nov 12, 2014 at 3:26

1 Answer 1

2

If testing locally using Postgres is acceptable just setup the correct adapters. A sample database.yml:

common: &common
  adapter: postgresql
  encoding: utf8
  template: template0 # Required for UTF8 encoding
  username: <%= ENV["POSTGRES_USER"] %>
  password: <%= ENV["POSTGRES_PASSWORD"] %>
  host: <%= ENV["POSTGRES_HOST"] %>

development:
  <<: *common
  database: 'my_app_dev'

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *common
  database: 'my_app_test'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.