donald
donald

Reputation: 23737

Shared database on Heroku not working

I have app1 as:

~/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)
>> 

and app2 as:

~/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'
>> 

they both have th esame database URL but "User" is not recognized in the second one. Following the Heroku newsletter, this should work.

Thanks

Upvotes: 1

Views: 282

Answers (1)

kain
kain

Reputation: 5570

I don't think the problem is at database level, but in the app2 app.

Upvotes: 1

Related Questions