我已经APP1为:共享数据库无法正常工作
~/Code/notifier/app1(master) $ heroku config
BUNDLE_WITHOUT => development:test
DATABASE_URL => postgres://[email protected]/uobbhrmyhj
LANG => en_US.UTF-8
RACK_ENV => production
SHARED_DATABASE_URL => postgres://[email protected]/uobbhrmyhj
~/Code/notifier/app1(master) $ heroku console
Ruby console for app1.heroku.com
>> User
=> User(id: integer, email: string, encrypted_password: string, reset_password_token: string, reset_password_sent_at: datetime, remember_created_at: datetime, sign_in_count: integer, current_sign_in_at: datetime, last_sign_in_at: datetime, current_sign_in_ip: string, last_sign_in_ip: string, confirmation_token: string, confirmed_at: datetime, confirmation_sent_at: datetime, created_at: datetime, updated_at: datetime)
>>
和App2为:
~/Code/notifier/app2(master) $ heroku config
BUNDLE_WITHOUT => development:test
DATABASE_URL => postgres://[email protected]/uobbhrmyhj
LANG => en_US.UTF-8
RACK_ENV => production
SHARED_DATABASE_URL => postgres://[email protected]/uobbhrmyhj
~/Code/notifier/app2(master) $ heroku console
Ruby console for app2.heroku.com
>> User
NameError: uninitialized constant User
/home/heroku_rack/lib/console.rb:150:in `block (2 levels) in <top (required)>'
/home/heroku_rack/lib/console.rb:140:in `eval'
/home/heroku_rack/lib/console.rb:140:in `_eval'
/home/heroku_rack/lib/console.rb:73:in `block in process_command'
>>
两人都日esame数据库的URL,但“用户”是不是在第二个承认。在Heroku通讯之后,这应该起作用。
感谢
你的应用在本地工作吗?它在自己的数据库上运行在heroku上吗? – bassneck
是的。从示例代码中可以看出,它在app1中有效。 – donald