Localhost CreateQueuedPosts error

(Mittineague) #1

I sync’d my localhost install of Master the other day but can’t figure out what’s wrong or how to fix it

CLI shows

[vagrant@precise32:/vagrant (master)]$ bundle exec rake db:migrate
== 20150325190959 CreateQueuedPosts: migrating ================================
-- create_table(:queued_posts, {:force=>true})
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedObject: ERROR:  type "json" does not exist
LINE 1: ...ger NOT NULL, "raw" text NOT NULL, "post_options" json NOT N...
: CREATE TABLE "queued_posts" ("id" serial primary key, "queue" character 
varying(255) NOT NULL, "state" integer NOT NULL, "user_id" integer NOT NULL, "raw" 
text NOT NULL, "post_options" json NOT NULL, "topic_id" integer, "approved_by_id" 
integer, "approved_at" timestamp, "rejected_by_id" integer, "rejected_at" 
timestamp, "created_at" timestamp, "updated_at" timestamp) 
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/rack-mini-profiler-0.9.3/lib/patches/db/pg.rb:90:in `exec'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/rack-mini-profiler-0.9.3/lib/patches/db/pg.rb:90:in `async_exec'
/usr/local/rvm/gems/ruby-2.0.0-p0-turbo/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'

if I start the server anyway the browser shows

Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development

Extracted source (around line #10):
8     end
10    call_without_quiet_assets(env).tap do
11      Rails.logger.level = previous_level
12    end
13   end

Rails.root: /vagrant

Application Trace | Framework Trace | Full Trace
config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
config/initializers/silence_logger.rb:26:in `call'
lib/middleware/missing_avatars.rb:21:in `call'
lib/middleware/turbo_dev.rb:33:in `call'

* trying RAILS_ENV=development did not fix things

Ideas please

(Robin Ward) #2

Check your version of postgres. Json might be in a later release.

(Mittineague) #3

My Postgres was from 14 months ago.
I updated it, restarted my computer and tried again.
Still no joy, but I’m sure I missed doing something along the way.

The good news is that when I switched from master to beta and tried - It’s Alive !!!

I can live with that, as long as I can work on plugins I’m a happy camper.

(Sam Saffron) #4

json data type is only supported on PG 9.3 and up.

@eviltrout we should probably update dev docs to mention 9.3 and up is required.


Yeah I’m getting this in the vagrant environment as well. Is this not the supported dev environment anymore?

(Robin Ward) #6

It sounds like our vagrant image needs to be updated. It has been a long time!

(Simon Cossar) #7

When I enter psql into the terminal using the current vagrant image, this is what I get.

[vagrant@precise32:/vagrant (try-things-out)]$ psql
psql (9.1.8)
Type "help" for help.


Is that the relevant postgres, or is it the one on my host machine that matters?


The postgres version within their Vagrant image needs to be updated, thats all. I can confirm the workaround above is working however (switching to beta as opposed to master)


Another thing to keep in mind is that mailcatcher isn’t installed.

(Robin Ward) #10

I’ve updated our vagrant VM to support the latest postgres and ruby. It should be faster and cleaner to use too:


(Jeff Atwood) #11

Are any changes to the related blog entry needed?

(Robin Ward) #12

I forgot about that! I used the latest version of vagrant so if you update the blog to say to install 1.7.2 or later that would be good. Everything else looks fine.

(Jeff Atwood) #13

Ok I updated the blog post to reflect current versions… @techapj will run through it as well to see if all is good.

(Arpit Jalan) #14

I just installed Discourse as my first Rails app on Windows! :blush:

Here’s the screenshot of Discourse running on my Surface Pro 2:

So I can confirm everything is good! Thanks for the update @eviltrout!

(Jens Maier) #15

Wow, for a second there I thought Discourse was now actually running natively on Win32… :unamused: