-1

I am learning ruby on rails and heroku. I have some questions. Could somebody help me?

  1. After running heroku create, the terminal is somehow connected to the repository/project in heroku. After that the developer can see logs, access database, ect. But, how can I access via terminal my completed project,which is online already, in heroku without creating the same apps and upload it again to heroku?
  2. How can access my pg database in heroku or offline? I saw this and try to run heroku pg:psql. it gives me hidden-atoll-4790::DATABASE=> help I try \? to see pg command but I cannot use it.
  3. I saw this link to see pg db offline. But why cannot I access /var/lib/postgresql/9.3/main directory ? it is said that I don't have permission eventhough my account is administrator account.

2 Answers 2

0

1.Run heroku run rails console

Sign up to request clarification or add additional context in comments.

4 Comments

Code-only answers are not as helpful as answers that have working code plus helpful explanations. In this case, it would be worthwhile explaining this answer to a 5 year old.
thanks. Last night I figured out this the-name-of-the-model.all. it helps me to see inside the db though I still do not know another query commands.
@Codelearner777 so if my answer was helpful, please mark it as acepted, and if you have further questions please ask it in new thread
@weezing, thanks for your answer but that is not what I want to know :)
0

Run

$ heroku apps # to see all apps created by your account
$ heroku open # to open you current project in browser (run it form root of your project)
$ heroku pg:psql DATABASE_URL # to gain access to heroku postgresql terminal, here you can run SQL queries

Refer to

CLI and Heroku PG for more info

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.