-
-
Save terryjray/3296171 to your computer and use it in GitHub Desktop.
RAILS_ENV=production rake db:setup | |
# produces the error below.....hmmm.....it's a no-worky | |
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory | |
# hstore postgresql extension needs to be installed, so.... | |
sudo apt-get install postgresql-contrib | |
# now your extension should be available to enable so log in with psql | |
psql -d yourproject_production -U yourdbuser -W | |
# in the psql shell | |
CREATE EXTENSION hstore; | |
\q | |
# now you're golden, may need to clean up and re-run | |
RAILS_ENV=production rake db:drop | |
RAILS_ENV=production rake db:setup |
Below link helped me to resolve this issue.
http://clarkdave.net/2012/09/postgresql-error-type-hstore-does-not-exist/
worked for me too!
@giedriusr I'm having the same permissions problem as you had. Could you tell me how you could get around them? Thanks in advance!
I also had permission issue, I just log in to my DB via psql and then executed the below command:
CREATE EXTENSION hstore;
problem solved.^^
Like a charm.. :)
works fine for me PG 9.1 + Ubuntu 12.10, thanks!
What I did was just
postgres# ALTER ROLE <user_name> SUPERUSER;
And that's it! Run migration again.
Instead of opening up a psql shell, you can just run psql -c "CREATE EXTENSION hstore"
That lets you script this whole shebang.
discourse
project will need this
Thanks
I had the same permission issue on postgresql 9.4 on ubuntu 12.04 LTS. Doing the following worked:
sudo su postgres -c "psql db_name -c 'CREATE EXTENSION hstore;'"
I got this from: dokku-alt/dokku-alt#66
@waterlink funny:)
@scifisamurai, thanks, that helped me.
thanks
I'm using Rails 5.0.2
and Postgres 9.5
on Ubuntu 16.04.3 LTS
and what worked for me are the next two options:
First one:
- Install the extension with:
sudo apt-get install postgresql-contrib
- Enable the extension in the corresponding Data Base:
sudo su postgres -c "psql my_db_production -c 'CREATE EXTENSION hstore;'"
Second one:
- Install the extension with:
sudo apt-get install postgresql-contrib
- Login as super user in Postgres
sudo su - postgres
- Enter to your Data Base console:
psql -d my_db_production -W
- In the psql shell run:
CREATE EXTENSION hstore;
- Exit
\q
Now migrations run with out any error!
I hope it could be useful!
Everything worked. thanks