0

I've been at this for an hour or two, but can't seem to figure out what the problem may be.

I was using sqlite3 for dev but before pushing to heroku I decided to switch to pg (using ubuntu), and it works fine on my local dev environment.

then I pushed to Heroku I keep getting a blank bage with the follow:

We're sorry, but something went wrong.

'this doesn't really help. Is there a log file for production I can access via heroku?

Also my best guess is it has something to do with the bd, maybe it didn't load properly. I checked my heroku account and click the following addon:

Heroku Postgres Dev :: Olive

now my db says size of 6mb but tables 0, which is concerning. However I don't know how to query my db on heroku and there seems to be no interface on the site to view my db. Does db not automatically push with "git push heroku master"

Anyways, db is my best guess at the moment but I can't be certain, I'm not sure what to do since I have no logs

EDIT:

I was able to check the db on heroku using:

heroku pg:psql

from https://devcenter.heroku.com/articles/heroku-postgresql however, there are no enteries in my db, there are enteries in my dev db but apparently it did not transfer to heroku, is there a way to push (or overwrite) your heroku db with the one in your dev environment?

Kyle: I tried the taps thing,Failed to connect to database:

  Sequel::DatabaseConnectionError -> PG::Error: FATAL:  password authentication fai
led for user "pc"
FATAL:  password authentication failed for user "pc" however I get the error:

pc us my username for pg on my ubuntu machine, however my password is ok since its working on my local machine

my database.yml file

development:
  adapter: postgresql
  encoding: utf8
  reconnect: false
  database: someapp_development
  pool: 5
  username: pc
  password: ***

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: postgresql
  encoding: utf8
  reconnect: false
  database: someapp_development
  pool: 5
  username: pc
  password: ***

production:
  adapter: postgresql
  encoding: utf8
  reconnect: false
  database: someapp_development
  pool: 5

EDIT: I checked the log and it is infact the db causing the problem, the enteries in my table aren't being pushed into heroku and with an empty db my app is crashing (bad design I know)

4

2 に答える 2

0

私の記憶が正しければ、ユーザー postgres にはデフォルトで Ubuntu に DB パスワードが設定されていません。つまり、postgres OS ユーザー アカウントを使用する場合、そのアカウントにのみログインできます。

ボックスに root アクセスできると仮定すると、次のことができます。

sudo -u postgres psql

それでも失敗する場合database "postgres" does not exists error,は、Ubunutu または Debian サーバーを使用していない可能性があります :-) この場合template1は、コマンドに次のように追加するだけです。

sudo -u postgres psql template1

これらのコマンドのいずれかがエラーで失敗しpsql: FATAL: password authentication failed for user "pc"、ファイルを確認します/etc/postgresql/8.4/main/pg_hba.conf:。最初の非コメント行として、次のような行が必要です。

local   all         postgres                          ident

PostgreSQL の新しいバージョンでは、ident実際にはpeer. それもOKです。

シェル内で、 DBユーザーにパスワードpsqlを与えることができます。postgres

ALTER USER postgres PASSWORD 'newPassword';

これで、pgAdmin に DB スーパーユーザーの有効なパスワードを与えることができるはずです。:-)

于 2012-10-05T06:24:35.277 に答える
0

本番データベースの移行が必要になる場合があります

heroku run rake db:migrate
heroku restart

heroku db にデータをインポートする必要がある場合は、こちらを参照してください

 gem install taps   
 heroku db:push

編集: この代替方法を試してください:

heroku db:push postgres://user:pass@localhost/dbname
于 2012-10-04T02:30:36.867 に答える