Rails Rubber gem with a mysql2 adapter - Access denied for user error - ruby-on-rails-3.1

I'm trying to use a nice simple Rails app (1 model with 2 fields) to learn how to deploy an app to an Amazon Web Services (AWS) EC2 instance server using the mysql2 data adapter. I'm trying to use the Rubber Gem to do the deployment. Everything looks good (bootstrap & deploy) until I try browsing the website. The apache2 error.log shows this error when I enter the URL for the index page of the model:
*** Exception PhusionPassenger::UnknownError in
PhusionPassenger::Rack::ApplicationSpawner
(Access denied for user ''#'blog.foo.com' to database 'blog_production'
(Mysql2::Error))
Why can't the mysql db be accessed? Everything looks good that Rubber setup.
The full error.log data is
[ pid=19455 thr=19477020 file=utils.rb:176 time=2012-09-13 23:25:01.220 ]: *** Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (Access denied for user ''#'blog.foo.com' to database 'blog_production' (Mysql2::Error)) (process 19455, thread #<Thread:0x00000002526438>):
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:304:in `new_connection'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:323:in `checkout_new_connection'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block (2 levels) in checkout'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in `loop'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in `block in checkout'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:260:in `checkout'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:162:in `connection'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in `retrieve_connection'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in `retrieve_connection'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:701:in `table_exists?'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:792:in `attribute_names'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/params_wrapper.rb:168:in `_set_wrapper_defaults'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/params_wrapper.rb:128:in `inherited'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
from /mnt/blog-production/releases/20120914032205/app/controllers/articles_controller.rb:1:in `<top (required)>'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:348:in `require_or_load'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:302:in `depend_on'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:214:in `require_dependency'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:416:in `block (2 levels) in eager_load!'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:415:in `each'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:415:in `block in eager_load!'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:413:in `each'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:413:in `eager_load!'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/finisher.rb:51:in `block in <module:Finisher>'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /mnt/blog-production/releases/20120914032205/config/environment.rb:5:in `<top (required)>'
from config.ru:3:in `require'
from config.ru:3:in `block in <main>'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
from /mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb:225:in `eval'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb:225:in `load_rack_app'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb:157:in `block in initialize_server'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/utils.rb:572:in `report_app_init_status'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb:154:in `initialize_server'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb:180:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
from <internal:prelude>:10:in `synchronize'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.12/helper-scripts/passenger-spawn-server:99:in `<main>'
[ pid=19516 thr=140129381447488 file=ext/apache2/Hooks.cpp:862 time=2012-09-13 23:25:01.326 ]: Unexpected error in mod_passenger: Cannot spawn application '/mnt/blog-production/releases/20120914032205': An error occured while spawning the application.
Backtrace:
in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:742)
in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:294)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:563)
The config/database.yml file on the deployed sever is
production:
adapter: mysql2
encoding: utf8
database: blog_production
username: blog
password:
host: blog.foo.com
pool: 5
Is there any additional information that would help track down the problem?
I'm going on two weeks now trying to get the website deployed at AWS. One of these days I'm going to git pay dirt.
Thanks, Russ
I saw the password field is blank, so set a value for the db_pass variable in the rubber-mysql.yml
db_user: "#{app_name[0,16]}"
db_pass: kickback
db_name: "#{app_name}_#{Rubber.env}"
I tried just doing a cap rubber:bootstrap followed by a cap deploy hoping that would fill in the password value on the server in the config/database.yml file. That didn't work, so I did a full cap rubber:create_staging. The yml file now has the password filled in
production:
adapter: mysql2
encoding: utf8
database: blog_production
username: blog
password: kickback
host: blog.foo.com
pool: 5
But the tail end of the create_staging command showed this error
* executing "cd /mnt/blog-production/releases/20120914041247 && bundle exec rake RAILS_ENV=production db:migrate"
servers: ["blog.foo.com"]
[blog.foo.com] executing command
** [out :: blog.foo.com] rake aborted!
** [out :: blog.foo.com]
** [out :: blog.foo.com] Access denied for user 'blog'#'blog.foo.com' (using password: YES)
** [out :: blog.foo.com]
** [out :: blog.foo.com]
** [out :: blog.foo.com] Tasks: TOP => db:migrate
** [out :: blog.foo.com]
** [out :: blog.foo.com] (See full trace by running task with --trace)
** [out :: blog.foo.com]
command finished in 25336ms
failed: "/bin/bash -l -c 'cd /mnt/blog-production/releases/20120914041247 && bundle exec rake RAILS_ENV=production db:migrate'" on blog.foo.com
What to try next? Maybe trying the rake db:migrate manually.
$ RAILS_ENV=production rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
Rails Error: Unable to access log file. Please ensure that /mnt/blog-production/releases/20120914041247/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
rake aborted!
Access denied for user 'blog'#'blog.foo.com' (using password: YES)
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:304:in `new_connection'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:323:in `checkout_new_connection'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block (2 levels) in checkout'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in `loop'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in `block in checkout'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:260:in `checkout'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:162:in `connection'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in `retrieve_connection'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in `retrieve_connection'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/migration.rb:633:in `initialize'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/migration.rb:549:in `new'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/migration.rb:549:in `up'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/migration.rb:530:in `migrate'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:161:in `block (2 levels) in <top (required)>'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/mnt/blog-production/shared/bundle/ruby/1.9.1/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.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/mnt/blog-production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p290#global/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p290#global/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:migrate
Is it time for me to give up on using Rubber?

It's a MySQL authentication issue. It is matching your user against the anonymous accounts first (due to the host name) and so the access is limited.
If you ssh in to your server and type this you should fail the same way:
$ mysql -u blog -h blog.foo.com -p kickback
ERROR 1045 (28000): Access denied for user 'blog'#'blog.foo.com' (using password: YES)
See my detailed solution here.

Related

Capistrano 3 deployment is broken

my capistrano3 deployment is broken. I really don't know why, it was like yesterday it works and today it doesn't. Please have a look at the error it gives me:
cap aborted!
Errno::ENOENT: No such file or directory # rb_file_s_stat - /tmp/PROJECT-0d9226685f71.tar.gz
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp/upload.rb:117:in `stat'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp/upload.rb:117:in `set_current'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp/upload.rb:24:in `upload_start_state'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp.rb:369:in `block (3 levels) in start_command'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/channel.rb:324:in `call'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/channel.rb:324:in `process'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:223:in `block in preprocess'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:223:in `each'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:223:in `preprocess'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:206:in `process'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:170:in `block in loop'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp.rb:284:in `upload!'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:34:in `block in upload!'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:141:in `with_ssh'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:33:in `upload!'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/capistrano-scm-gitcopy-0.1.2/lib/capistrano/tasks/gitcopy.rake:79:in `block (4 levels) in <top (required)>'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:64:in `within'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/capistrano-scm-gitcopy-0.1.2/lib/capistrano/tasks/gitcopy.rake:77:in `block (3 levels) in <top (required)>'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `instance_exec'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `run'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => gitcopy:create_release
The deploy has failed with an error: No such file or directory # rb_file_s_stat - /tmp/PROJECT-0d9226685f71.tar.gz
** Invoke deploy:failed (first_time)
** Execute deploy:failed
I don't know what it is. Maybe some capistrano bug or a bug in my configs? Let me know if you need more informations
Answer is following:
https://github.com/xuwupeng2000/capsitrano-scm-gitcopy#installation
Finally, DO NOT ADD require 'capistrano/gitcopy' to Capfile because capistrano/setup already loads the scm module with the :scm value you specified.

Test suite before upgrade to rails 4.2 from rails 3.2

I recently tried to updated my Rails app from Rails 3.2 to Rails 4.2. Before the upgrade all my test suite runs perfectly, but after the update I'm getting something strange. every time i tried to run a test the same error happens
rake db:fixtures:load --trace
** Invoke db:fixtures:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:fixtures:load
rake aborted!
NameError: uninitialized constant ActiveRecord::FixtureSet::RenderContext::MassiveMessage
(erb):11:in `get_binding'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/erb.rb:863:in `eval'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/erb.rb:863:in `result'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:42:in `render'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:33:in `rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:24:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:758:in `block (2 levels) in read_fixture_files'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:15:in `open'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:757:in `block in read_fixture_files'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:756:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:756:in `each_with_object'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:756:in `read_fixture_files'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:592:in `initialize'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:514:in `new'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:514:in `block (2 levels) in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:511:in `map'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:511:in `block in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:282:in `disable_referential_integrity'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:508:in `create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:203:in `block (3 levels) in '
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/home/alexander/.rvm/rubies/ruby-2.2.0/bin/rake:33:in `'
Can anyone help me with this?
After deleting that Fixtures i get another error see
rake aborted!
TypeError: no implicit conversion of Fixnum into String
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:636:in `gsub'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:636:in `block (2 levels) in table_rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:635:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:635:in `block in table_rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:623:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:623:in `map'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:623:in `table_rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:526:in `block (3 levels) in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:524:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:524:in `block (2 levels) in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:523:in `block in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:282:in `disable_referential_integrity'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:508:in `create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:203:in `block (3 levels) in '
Tasks: TOP => db:fixtures:load
(See full trace by running task with --trace)
:(
I did a progressive updatefrom rails 3.2 to 4.02, then from 4.02 to 4.1, all worked smoothly, then at rails 4.2 i got the same error
i posted the issue at github in rails repositories and they answer me that it's a bug and will be released at version 4.2.1
for the moment you can correct this doing this.
row[key] = value.gsub("$LABEL", label.to_s) if value.is_a?(String)
at line 636 of the file fixture.rb from activerecord library

Redmine: receive_imap of Gmail account behind a proxy

I'm trying to receive incoming mails from a Gmail account on Redmine, but my organization uses an authenticated proxy, and I'm getting this error:
$ sudo rake -f /app/redmine-2.4.5/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com port=993 ssl=1 username=foo#gmail.com password=foopassword project=myotragus unknown_user=accept folder=INBOX move_on_success=redmine-processed move_on_failure=redmine-error allow_override=project unknown_user=accept no_permission_check=1 --trace
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
Network is unreachable - connect(2)
/usr/lib/ruby/1.9.1/net/imap.rb:1034:in `initialize'
/usr/lib/ruby/1.9.1/net/imap.rb:1034:in `open'
/usr/lib/ruby/1.9.1/net/imap.rb:1034:in `initialize'
/app/redmine-2.4.5/lib/redmine/imap.rb:29:in `new'
/app/redmine-2.4.5/lib/redmine/imap.rb:29:in `check'
/app/redmine-2.4.5/lib/tasks/email.rake:125:in `block (3 levels) in <top (required)>'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/var/lib/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => redmine:email:receive_imap
Is there a way to connect to a Gmail account in Redmine behind a proxy?
I'm using Redmine-2.4.5 on Ubuntu 14.10, and I have defined http_proxy env var.

Resque workers fail upon startup

Resque workers won't start locally in my rails application. I enter the following command to startup a worker.
COUNT=1 QUEUE=* rake resque:work --trace
And I run into the following error. I had this working before, not sure what is causing the error to appear now.
(in /home/omar/Github/brooklin)
** Invoke resque:work (first_time)
** Invoke resque:preload (first_time)
** Invoke resque:setup (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute resque:setup
** Execute resque:preload
rake aborted!
No such file to load -- exception
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:317:in `rescue in depend_on'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:312:in `depend_on'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:225:in `require_dependency'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:438:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:438:in `block in eager_load!'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:436:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:436:in `eager_load!'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/gems/resque-1.21.0/lib/resque/tasks.rb:54:in `block (2 levels) in <top (required)>'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/omar/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/home/omar/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `load'
/home/omar/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `<main>'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/bin/ruby_noexec_wrapper:14:in `eval'
/home/omar/.rvm/gems/ruby-1.9.3-p194#Brooklin/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => resque:work => resque:preload
As well below is my lib/tasks/resque.rake file.
require 'resque/tasks'
require 'resque_scheduler/tasks'
task "resque:setup" => :environment do
ENV['QUEUE'] = '*'
end
desc "Alias for resque:work (To run workers on Heroku)"
task "jobs:work" => "resque:work"
task "resque:scheduler_setup" => :environment
I've added the resque.rake file to the load path by adding the following in the config/application.rb
config.autoload_paths += %W(#{config.root}/lib/tasks/)
Thanks for your help.
The output statement is a little misleading.
No such file to load -- exception
Turns out I had require exception in one of my models, and it was complaining because it couldn't find the file exception.

Rails 3.2 - can't precompile assets

I am trying to precompile assets (rake assets:precompile or bundle exec rake assets:precompile), but I always get the error
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Access denied for user 'root'#'localhost' (using password: YES)
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/Users/adam/.rvm/rubies/ruby-1.9.2-p290/b...]
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
Has anybody an idea what could be wrong?
EDIT trace output
rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/adam/.rvm/gems/ruby-1.9.2-p290/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
rake aborted!
Access denied for user 'root'#'localhost' (using password: YES)
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/model_schema.rb:308:in `clear_cache!'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.1/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:418:in `_run__1002303312927586119__prepare__1187908839264703097__callbacks'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.1/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.1/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/adam/rubydev/aivloo/config/environment.rb:5:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application.rb:103:in `require_environment!'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.1/lib/sprockets/assets.rake:89:in `block (2 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.1/lib/sprockets/assets.rake:56:in `block (3 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => environment
rake aborted!
Command failed with status (1): [/Users/adam/.rvm/rubies/ruby-1.9.2-p290/b...]
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/file_utils.rb:80:in `ruby'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.1/lib/sprockets/assets.rake:9:in `ruby_rake_task'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.1/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.1/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile
Not your issue, but if a Google search brings someone else here (as it did me) make sure you're specifying what RAILS_ENV you're in:
rake assets:precompile RAILS_ENV=development
I was running a precompile test in development and kept getting this error until I remembered to put the environment.
You've got a wrong password/username combination for your MySQL database. There are some gems that "need" database access for asset precompilation, to turn this off, check this question for Devise.

Resources