UndefinedTable: ERROR: relation "activities" does not exist

1,434 views
Skip to first unread message

Rob Silva

unread,
Aug 10, 2014, 5:48:22 PM8/10/14
to public-...@googlegroups.com
Hi Guys,

I am trying to set up this gem but have run into a problem. Has anyone encountered this?

PG::UndefinedTable: ERROR: relation "activities" does not exist LINE 5: WHERE a.attrelid = '"activities"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"activities"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum


I did install the gem property and ran the migration per instructions.

rails g public_activity:migration
rake db:migrate
shout.rb
include PublicActivity::Common
belongs_to :user
end

class ActivitiesController < ApplicationController
def index
@activities = PublicActivity::Activity.all
end
end

<% @activities.each do |activity| %>
  <div class="activity">
    <%= link_to activity.owner.email, activity.owner if activity.owner %>
    <%= render_activity activity %>
  </div>
<% end %>


My setup:
Rails 4
Using ActiveRecord

Any help would be greatly appreciated! :)

Thanks!

Rob Silva

unread,
Aug 10, 2014, 6:04:42 PM8/10/14
to public-...@googlegroups.com
I figured it out.

For some reason, the migration file was being generated without ".rb" at the end.
Reply all
Reply to author
Forward
0 new messages