0
votes

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:inresolve_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:inestablish_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:ininstance_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:inblock 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:inon_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:ininstance_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:inblock 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:inrun_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:inmethod_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:inload' 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:inload_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:inresolve_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:inestablish_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:ininstance_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:inblock 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:inon_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:ininstance_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:inblock 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:inrun_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:inmethod_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:inload' 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:inload_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.

2
what's your database? That's where it's blowing upAnthony
sqlite3 in dev/test and pg in productionJoseph Gill

2 Answers

2
votes

I see rpush-1.0.0 in your stacktrace. 1.0.0 is very old. Please use 2.2.0

0
votes

database configuration does not specify adapter indicates that the config/database.yml file has not been set up correctly. See http://guides.rubyonrails.org/configuring.html#configuring-a-database for details about what should be in that file.

Specifically, the error message is pointing to not finding adapter: <database type>

https://gist.github.com/erichurst/961978 has some examples of database.yml that you could refer to while setting up one.