0
我剛剛在Cloud9中爲Heroku(woohoo!)啓動了我的Rails應用程序。我的默認數據庫是sqlite3的,所以我說的PostgreSQL在我的寶石這樣的部署過程:在我的新PostgreSQL生產數據庫中運行查詢
# Use postgresql as the database in production
group :production do
gem 'pg'
end
# Use sqlite3 as the database in development
group :development do
gem 'sqlite3'
end
我要保持我的sqlite3的數據庫開發和使用PostgreSQL進行生產。我的問題是如何監視或運行我的生產Heroku網站中的PostgreSQL數據查詢。
我習慣於在終端上運行「rails c」,然後「User.all」來查看我的用戶。現在,如果我運行它,它不會顯示任何生產數據。我如何看到這些數據?我做了一些搜索,我想我應該使用「psql」命令。但是,如果我跑「的psql -l」比如我得到:
psql: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?