rake db:create gets "undefined method `[]'" - ruby-on-rails

While tweaking a rails app I wrote long ago I dropped the database to start the migrations over.
Oopsie - now even a basic db:setup isn't working!
If I recall correctly, one does
$ RAILS_ENV=development bundle exec rake db:setup
$ RAILS_ENV=development bundle exec rake db:migrate
I think the problem is my database is no longer being recognized by rake/rails.
Any guesses as to why?
My database.yml has not changed recently!
test:
adapter: postgresql
database: argotifier_test
username: argotifier
password: start123
host: localhost
pool: 5
Here's the trace when I run the rake tasks:
$ RAILS_ENV=test bundle exec rake db:setup --trace
** Invoke db:setup (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
rake aborted!
undefined method `[]' for nil:NilClass
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:74:in `rescue in create_database'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:54:in `create_database'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/bin/rake:23:in `load'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/bin/rake:23:in `<main>'
Tasks: TOP => db:setup => db:create
$ RAILS_ENV=test bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
rake aborted!
test database is not configured
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie.rb:69:in `block (2 levels) in <class:Railtie>'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/base.rb:2190:in `<top (required)>'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:6:in `block (2 levels) in <top (required)>'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/bin/rake:23:in `load'
/Users/monkeywidget/.rbenv/versions/1.9.3-p429/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate => db:load_config

You should run rake db:test:prepare for the test database.
Check this for more options.

Related

Error with heroku run rake db:migrate - Errno::ENOENT: No such file or directory - /app/db/schema.rb

I was trying to get my project working on Heroku but when I was trying to run "rake db:migrate" got the following
any idea????
Thanks :)
P.D: I think the probles is here
** Execute db:schema:dump
rake aborted!
Because
Rake tasks that write to disk, such as rake db:schema:dump, are not compatible with Heroku’s ephemeral filesystem.
PS C:\Users\siel3\Documents\nimbus> heroku run rake db:migrate --trace
Running `rake db:migrate --trace` attached to terminal... up, run.6524
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
rake aborted!
Errno::ENOENT: No such file or directory - /app/db/schema.rb
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:243:in `initialize'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:243:in `open'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:243:in `block (3 levels)
in <top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:50:in `block (2 levels)
in <top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:45:in `block (2 levels)
in <top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'
Tasks: TOP => db:schema:dump
Do you not have a db/schema.rb file in your application? That file should be in ApplicationName/db/schema.rb If this is your first upload to heroku maybe try to run rake db:seed first to create the schema file, then do your migrations after.
The problem was Windows...
Windows rename the /db folder as /DB, and heroku breaks if this happens.

rake db:seed not working in dev - pg is running but the connection is being refused

I'm trying to follow along on this tutorial and can't get past the setup of pg.
https://shellycloud.com/blog/2013/10/adding-search-and-autocomplete-to-a-rails-app-with-elasticsearch
I set up pg on my computer using the postgres app, and I installed it successfully in my app using bundle install, but whenever I run rake db:seed I get the error below. pg is running on port 5432, I've tried uninstalling and installing again. rails server runs fine, and psql is working in the terminal.
I have been searching for hours and can't find anything that can explain what the issue is - most answers are to do with sunspot solr which I'm not using. I have already increased my system's shared memory as advised in the postgres app documentation:
sudo sysctl -w kern.sysv.shmall=65536
sudo sysctl -w kern.sysv.shmmax=16777216
I added the following to my development config as another answer mentioned this as a potential solution:
config.action_mailer.perform_deliveries = false
Any help would be very much appreciated!
This is the error I get when I run rake db:seed
michaels-air:bookstore_search michaeltaylor$ rake db:seed --trace
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
rake aborted!
Connection refused - connect(2)
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:878:in `initialize'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:878:in `open'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:877:in `connect'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:851:in `start'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/http/client.rb:19:in `post'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/index.rb:146:in `store'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/model/search.rb:148:in `block in update_index'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:373:in `_run__4090249372457318285__update_elasticsearch_index__callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/model/search.rb:144:in `update_index'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/model/callbacks.rb:21:in `block in included'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:386:in `_run__4090249372457318285__save__callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/callbacks.rb:299:in `create_or_update'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/persistence.rb:106:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/validations.rb:51:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/attribute_methods/dirty.rb:32:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:270:in `block (2 levels) in save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:326:in `block in with_transaction_returning_status'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:209:in `transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:323:in `with_transaction_returning_status'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:270:in `block in save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:281:in `rollback_active_record_state!'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:269:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/persistence.rb:37:in `create'
/Users/michaeltaylor/Codes/bookstore_search/db/seeds.rb:19:in `block in <top (required)>'
/Users/michaeltaylor/Codes/bookstore_search/db/seeds.rb:18:in `each'
/Users/michaeltaylor/Codes/bookstore_search/db/seeds.rb:18:in `<top (required)>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/engine.rb:540:in `load_seed'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:153:in `load_seed'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:181:in `block (2 levels) in <top (required)>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/rake:23:in `load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/rake:23:in `<main>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:seed
This is my config yml
development:
adapter: postgresql
encoding: unicode
database: bookstore_development
pool: 5
username: michaeltaylor
password:
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
host: localhost
This is what I get if I try and run rake db:setup
michaels-air:bookstore_search michaeltaylor$ rake db:setup --trace
** Invoke db:setup (first_time)
** Invoke db:schema:load_if_ruby (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:create
bookstore_development already exists
bookstore_test already exists
** Invoke environment (first_time)
** Execute environment
** Execute db:schema:load_if_ruby
** Invoke db:schema:load (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:load
-- enable_extension("plpgsql")
-> 0.0194s
-- create_table("authors", {:force=>true})
-> 0.0214s
-- create_table("authors_books", {:force=>true})
-> 0.0075s
-- create_table("books", {:force=>true})
-> 0.0123s
-- create_table("books_subjects", {:force=>true})
-> 0.0082s
-- create_table("subjects", {:force=>true})
-> 0.0092s
-- initialize_schema_migrations_table()
-> 0.0029s
** Invoke db:structure:load_if_sql (first_time)
** Invoke db:create
** Invoke environment
** Execute db:structure:load_if_sql
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment
** Execute db:abort_if_pending_migrations
rake aborted!
Connection refused - connect(2)
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:878:in `initialize'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:878:in `open'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:877:in `connect'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:851:in `start'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/http/client.rb:19:in `post'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/index.rb:146:in `store'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/model/search.rb:148:in `block in update_index'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:373:in `_run__1365093858615832810__update_elasticsearch_index__callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/model/search.rb:144:in `update_index'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/tire-0.6.0/lib/tire/model/callbacks.rb:21:in `block in included'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:386:in `_run__1365093858615832810__save__callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/callbacks.rb:299:in `create_or_update'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/persistence.rb:106:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/validations.rb:51:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/attribute_methods/dirty.rb:32:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:270:in `block (2 levels) in save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:326:in `block in with_transaction_returning_status'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:209:in `transaction'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:323:in `with_transaction_returning_status'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:270:in `block in save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:281:in `rollback_active_record_state!'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/transactions.rb:269:in `save'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/persistence.rb:37:in `create'
/Users/michaeltaylor/Codes/bookstore_search/db/seeds.rb:19:in `block in <top (required)>'
/Users/michaeltaylor/Codes/bookstore_search/db/seeds.rb:18:in `each'
/Users/michaeltaylor/Codes/bookstore_search/db/seeds.rb:18:in `<top (required)>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/engine.rb:540:in `load_seed'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:153:in `load_seed'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:181:in `block (2 levels) in <top (required)>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/Users/michaeltaylor/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/rake:23:in `load'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/rake:23:in `<main>'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/Users/michaeltaylor/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:setup => db:seed
Doesn't look like a Postgres issue. Judging by the stack trace, apparently you need to start your ElasticSearch server.

Rake aborted! Invalid byte sequence in UTF-8

This problem has been plaguing me for hours! When trying to precompile my assets on the AWS instance, I get the following:
bitnami#ip-10-117-75-230:/opt/bitnami/apache2/htdocs/my_broker_app$ sudo bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/opt/bitnami/ruby/bin/ruby /opt/bitnami/ruby/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
invalid byte sequence in UTF-8
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike/index.rb:82:in `block in entries'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike/index.rb:82:in `reject'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike/index.rb:82:in `entries'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:116:in `entries'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:190:in `block in each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/opt/bitnami/ruby/bin/rake:23:in `load'
/opt/bitnami/ruby/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/opt/bitnami/ruby/bin/ruby /opt/bitnami/ru...]
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `sh'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `sh'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils.rb:80:in `ruby'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `ruby'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/opt/bitnami/ruby/bin/rake:23:in `load'
/opt/bitnami/ruby/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile
I am running ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
I solved the issue by doing the following:
$ cd opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/hike-1.2.3/lib/hike
$ sudo chmod 777 index.rb
$ sudo vim index.rb
Then, insert (press letter i on keyboard): # encoding: utf-8 before first line.
Hit esc and then type :wq then press enter to save.
After, put permissions back for index.rb by doing the following
$ sudo chmod 644 index.rb
Hope this helps someone in the future.
In case anybody else comes across this question, while Tomanow's answer didn't quite work for me, I discovered there were offending characters in my file, which is what caused this issue.
The files, which came from Open Layers version 2.13, contained a copyright symbol in the comments section of some of their javascript and css files. Anybody else having a similar issue could also attempt to look for and remove those characters, if that's a feasible. Check out this answer for more details.
In my case the issue was happening on every rake task. I found out that it was due to the presence of some files with odd names that were accidentally created on the app's main directory, such as "?," and "\342,". Everything worked fine after I removed them.

Trying to add a dropdown field to my refinerycms engine

I'm trying to add a dropdown field to an already existing engine that I created. I followed this guide http://refinerycms.com/guides/multiple-resources-in-an-extension and when i ran the command rails g refinery:engine categories name:string --extension group_classes
I then tried running bundle install and then rails generate refinery:group_classes and then i got this error:
rake aborted!
Multiple migrations have the version number 1
I looked at the migrations in the vender/extensions/group_classes/db/migrate folder and they both had the prefix of 1. I changed the categories prefix to 2 and reran everything and it worked but then when i tried running rake db:seed, I get this error:
rake aborted!
uninitialized constant Refinery::GroupClasses::Engine
Full stack trace:
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
rake aborted!
uninitialized constant Refinery::GroupClasses::Engine
/var/www/vhosts/tomstestsite.us/PersonalTrainingKT/db/seeds.rb:46:in `<top (required)>'
/var/www/vhosts/tomstestsite.us/PersonalTrainingKT/refinerycms/ruby/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:520:in `load_seed'
/var/www/vhosts/tomstestsite.us/PersonalTrainingKT/refinerycms/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/railties/databases.rake:309:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `<main>'
Tasks: TOP => db:seed
What would cause this?
try use again without --extension group_classes OR you try to restart your server?

undefined method 'exitstatus' for nil nilclass on rake db:structure:dump

When I try to do a rake db:structure:dump in rails, for the first time. I needed to switch to the sql fromat. I get this: (PostgreSQL database)
C:\Sites\care>rake db:structure:dump --trace
Creating scope :search. Overwriting existing method PgSearch::Document.search.
** Invoke db:structure:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:structure:dump
C:/RailsInstaller/Ruby1.9.3/bin/rake: No such file or directory - pg_dump -i -s -x -O -f C:/Sites/care/db/structure.sql care_development
rake aborted!
undefined method `exitstatus' for nil:NilClass
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.1/lib/active_record/railties/databases.rake:390:in `block (3 levels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:19:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:19:in `<main>'
Tasks: TOP => db:structure:dump
Any idea on what might be the problem?
Add pg_dump to PATH and it will be fine.

Resources