I added the rpush gem to my gemfile and ran bundle install. The next step according to the documentation is to run rpush init. This gave me the following error.
You did not specify how you would like Rails to report deprecation notices for your init environment, please set config.active_support.deprecation to :log, :notify or :stderr at config/environments/init.rb
/Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in
resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in
resolve_string_connection'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in spec'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in
establish_connection'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/railtie.rb:82:in block (2 levels) in <class:Railtie>'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in
instance_eval'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in execute_hook'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:26:in
block in on_load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in each'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in
on_load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/railtie.rb:74:in block in <class:Railtie>'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:30:in
instance_exec'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:30:in run'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:55:in
block in run_initializers'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:54:in each'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:54:in
run_initializers'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/application.rb:136:in initialize!'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in
method_missing'
from config/environment.rb:5:in <top (required)>'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in
load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in block in load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in
load_dependency'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/rpush-1.0.0/bin/rpush:31:in
'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/rpush:23:in load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/rpush:23:in
'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in eval'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in
'
I then added an init.rb file into my environment folder that followed what the error suggested. Here is what I added to init.rb
CityRails::Application.configure do
config.active_support.deprecation = :log
end
I then ran rpush init again and I'm getting the following error
/Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in
resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in
resolve_string_connection'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in spec'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in
establish_connection'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/railtie.rb:82:in block (2 levels) in <class:Railtie>'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in
instance_eval'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in execute_hook'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:26:in
block in on_load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in each'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in
on_load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-3.2.13/lib/active_record/railtie.rb:74:in block in <class:Railtie>'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:30:in
instance_exec'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:30:in run'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:55:in
block in run_initializers'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:54:in each'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/initializable.rb:54:in
run_initializers'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/application.rb:136:in initialize!'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in
method_missing'
from config/environment.rb:5:in <top (required)>'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in
load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in block in load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in
load_dependency'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/gems/rpush-1.0.0/bin/rpush:31:in
'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/rpush:23:in load'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/rpush:23:in
'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in eval'
from /Users/mcarthur/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in
'
Please help. I've been working on this for 3 days. You guys are great.
Edit: I am using sqlite3 for test/dev environments and pg for production.
This is what my database.yml looks like:
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: postgresql
encoding: unicode
database: cityrails_production
pool: 5
Output from local rake db:migrate -
database: /Users/mcarthur/Desktop/apps/city-rails/db/development.sqlite3
Status Migration ID Migration Name
up 20140423191412 Create users up 20140423191450 Create contacts up 20140423191657 Create venues up 20140423191730 Create cities up 20140423194439 Create friendships up 20140423212732 Create invitations up 20140423212915 Add default to invitations status up 20140423213804 Create kptwilios up 20140423221018 Create push notifications up 20140423221315 Create device tokens up 20140423221356 Add default to device token environment up 20140423225205 Create delayed jobs up 20140430001800 Add user id to venues up 20140430001824 Add json info to venues up 20140616234552 Add api id to venues up 20140617012705 Add user id override to venues up 20140617024603 Add incognito to users up 20150107184219 Block users
Output from heroku run rake db:migrate -
database: dfvpbkpnbntg2f
Status Migration ID Migration Name
up 20140423191412 Create users up 20140423191450 Create contacts up 20140423191657 Create venues up 20140423191730 Create cities up 20140423194439 Create friendships up 20140423212732 Create invitations up 20140423212915 Add default to invitations status up 20140423213804 Create kptwilios up 20140423221018 Create push notifications up 20140423221315 Create device tokens up 20140423221356 Add default to device token environment up 20140423225205 Create delayed jobs up 20140430001800 Add user id to venues up 20140430001824 Add json info to venues up 20140616234552 Add api id to venues up 20140617012705 Add user id override to venues up 20140617024603 Add incognito to users up 20150107184219 Block users
I tried changing my database.yml file from cityrails_production to dfvpbkpnbntg2f and it did not work.