Forum: Ruby on Rails Heroku's “pg:psql” command doesn't work. How to pass commands to load schema from structure.sql?

1ac774797c9e79861840599b23653c3c?d=identicon&s=25 Wins Lin (zvooq)
on 2013-06-19 11:27
I want to load schema from structure.sql file to Heroku's database. On
my localhost machine I do as follows and all works just fine, all tables
are created:

> C:\> psql -U postgres -a -d MyApp_development -f C:\MyApp\db\structure.sql

But when I want to perform the same task on Heroku, it suddenly says !
App not found, although I provide all correct commands and data.

First of all, I get my credentials:
> C:\Heroku\MyApp>heroku pg:credentials DATABASE

Then I do copy/paste credentials and run the command but get App not
found:
> C:\Heroku\MyApp>heroku pg:psql DATABASE -U vmh... -a -d dc... -f
> "C:\MyApp\db\structure.sql"
>  !    App not found

But the app exists. When I run just heroku pg:psql I easily get
connected to my db:
> C:\Heroku\MyApp>heroku pg:psql DATABASE
> psql (9.2.4)
> SSL-connection (key: DMN-...-...-..., bit: 256)
> Enter "help" for information.
> dc..=>

Why it says the app isn't found? I provided all correct data. What else
do I need to pass to create tables on Heroku from structure.sql?
52f3528c40e9cf28ad0900886eecb128?d=identicon&s=25 Jordon Bedwell (Guest)
on 2013-06-19 12:44
(Received via mailing list)
On Wed, Jun 19, 2013 at 4:27 AM, Wins Lin <lists@ruby-forum.com> wrote:
> Why it says the app isn't found? I provided all correct data. What else
> do I need to pass to create tables on Heroku from structure.sql?

This is not Heroku support... Use
https://groups.google.com/forum/#!forum/heroku
1ac774797c9e79861840599b23653c3c?d=identicon&s=25 Wins Lin (zvooq)
on 2013-06-19 13:26
Jordon Bedwell wrote in post #1112859:
> On Wed, Jun 19, 2013 at 4:27 AM, Wins Lin <lists@ruby-forum.com> wrote:
>> Why it says the app isn't found? I provided all correct data. What else
>> do I need to pass to create tables on Heroku from structure.sql?
>
> This is not Heroku support...

Yes, this isn't. But my questions is not only about Heroku. It is about
Rails deployment primarily. May Rails deployment questions be posted
here? I think yes.
C993c6aaffc6cf7b477a5075099e1d36?d=identicon&s=25 Peter Hickman (Guest)
on 2013-06-19 15:26
(Received via mailing list)
Your question is not a general deployment question. It is heavily
dependent
on Heroku and as such somewhere more focused would be a better place to
ask.

As proof look at all the replies you have received!

That is because people see "oh he's having a problem with Heroku" (its
even
in the subject line) and then skip it because they know nothing about
Heroku.
479e8ecafa2b77dd13bccebaa85b4dd4?d=identicon&s=25 Hemant Gupta (hemant_g)
on 2014-10-13 09:24
Ithink It should worked...

cd your-rails-project
heroku pg:psql -a your-app-name <db/structure.sql
E0d583b15a80828654daba4fe8bf7d38?d=identicon&s=25 Michał Muskała (Guest)
on 2014-10-13 21:42
(Received via mailing list)
Have you tried simply using rake load task? This should do the trick.

heroku run rake db:structure:load

2014-10-13 9:24 GMT+02:00 Hemant Gupta <lists@ruby-forum.com>:
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.