I am trying to precompile assets on localhost with command bundle exec rake assets:precompile, the output is bellow:
/Users/adam/.rvm/gems/ruby-1.9.3-p385#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr/local/mysql in PATH, mode 040777
/Users/adam/.rvm/gems/ruby-1.9.3-p385#global/gems/bundler-1.2.3/lib/bundler.rb:263: warning: Insecure world writable dir /usr/local/mysql in PATH, mode 040777
/Users/adam/.rvm/rubies/ruby-1.9.3-p385/bin/ruby /Users/adam/.rvm/gems/ruby-1.9.3-p385/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
/Users/adam/.rvm/gems/ruby-1.9.3-p385#global/gems/bundler-1.2.3/lib/bundler.rb:263: warning: Insecure world writable dir /usr/local/mysql in PATH, mode 040777
rake aborted!
Access denied for user 'root'#'localhost' (using password: YES)
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.13/lib/mysql2/client.rb:58:in `connect'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.13/lib/mysql2/client.rb:58:in `initialize'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/model_schema.rb:308:in `clear_cache!'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/railtie.rb:97:in `block (2 levels) in <class:Railtie>'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:418:in `_run__4521211058967275969__prepare__3791545036321061180__callbacks'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/adam/rubydev/Fileito/config/environment.rb:5:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application.rb:103:in `require_environment!'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
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.3-p385/b...]
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval'
/Users/adam/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I am using SQLite database, not MySQL - why cannot I precompile the assets?
Add this line to config/application.rb
config.assets.initialize_on_precompile = false
It will prevent Rails to connecting to DB on assets precompilation.
I think you should fix
denied for user 'root'#'localhost'
Check your database configuration file and fix the database connection issue, then precompile assets
Related
so first time working with rails i work with django
I tried deploying the local server and it failed because of a key error known as s3_bucket_name because I didn't have the ENV file which contained the variables
so then i got the ENV file and placed it in the root of the application.
then I tried to launch the app with no go.
Then I ran the command rake.
Which it complained:
C:\Users\chris\Documents\suitsandtables>rake
rake aborted!
Gem::LoadError: You have already activated rake 12.1.0, but your Gemfile requires rake 12.0.0. Prepending `bundle exec` to your command may solve this.
so then I ran what it suggested with --trace
and I got the same returned. What am I doing wrong?
C:\Users\chris\Documents\suitsandtables>bundle exec rake --trace
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
rake aborted!
KeyError: key not found: "S3_BUCKET_NAME"
C:/Users/chris/Documents/suitsandtables/config/initializers/s3.rb:4:in `fetch'
C:/Users/chris/Documents/suitsandtables/config/initializers/s3.rb:4:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `load'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `block in load'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `load'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:655:in `block in load_config_initializer'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/notifications.rb:168:in `instrument'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:654:in `load_config_initializer'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:611:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:611:in `block in <class:Engine>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `instance_exec'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:59:in `block in run_initializers'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `tsort_each_child'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:415:in `call'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `call'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:58:in `run_initializers'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/application.rb:353:in `initialize!'
C:/Users/chris/Documents/suitsandtables/config/environment.rb:5:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/Users/chris/Documents/suitsandtables/test/test_helper.rb:1:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/Users/chris/Documents/suitsandtables/test/controllers/menus_controller_test.rb:1:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/test_requirer.rb:14:in `block in require_files'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/test_requirer.rb:13:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/test_requirer.rb:13:in `require_files'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/minitest_plugin.rb:67:in `rake_run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/testing.rake:14:in `block in <top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/bin/rake:22:in `load'
C:/RailsInstaller/Ruby2.3.3/bin/rake:22:in `<main>'
Tasks: TOP => default => test
the contents of the env file is as follows with sensitive info removed
S3_BUCKET_NAME=sat-paperclip-prod-heroku
AWS_ACCESS_KEY_ID= removed
AWS_SECRET_ACCESS_KEY= removed
AWS_REGION=us-east-1
GOOGLE_API_KEY= removed
can i get some help please
The error is caused by using Hash#fetch in config/initializers/s3.rb. That's a good thing. Don't change that. Your app requires that ENV value to work correctly, so it breaks if it's not set. (Everything within config/initializers/ runs on startup. This s3.rb file is not part of Rails core and was added by the app's author.)
Make sure your Gemfile has dotenv-rails specified. If it doesn't, add it (see https://github.com/bkeepers/dotenv) and type bundle in the terminal from your Rails root directory. (Note that dotenv-rails is also not part of Rails core.)
The root of your Rails app is the directory containing containing the files Gemfile, Gemfile.lock, etc. and the directories app/, bin/, config/, db/, lib/, etc. (i.e. C:/Users/chris/Documents/suitsandtables/). You can confirm by jumping into the Rails console (rails c or bundle exec rails c in the terminal) and typing Rails.root.
The env file should be named .env (thus the name of gem: dotenv) and should be located in your Rails root directory.
You can test your .env file through rails c by typing:
# in the rails console
ENV # your whole environment in a Hash
ENV["S3_BUCKET_NAME"] # your bucket name
Test all the environment values you're looking for. CaSe MaTtErS.
If you have any Rails servers or tasks running, restart them to pick up these changes.
The expected result of typing bundle exec rake is to run the tests. If you want to run the app itself, use rails s or bundle exec rails s.
p.s. Don't git add/commit your .env. It contains secrets. Make sure it is gitignored.
I have tried installing Redmine using MS Web Platform and from Helicon Zoo Web installer. I am using Windows 7 machine 64-bit and SQL server 2008. I have configured database.yml to connect to my SQL server DB and I m trying to migrate from SQLLite(default db) to SQLSERVER. Here is my configuration set up
production:
adapter: sqlserver
database: RedMineDB
host: XX.XX.XX.XXX/SQLEXPRESS
username: slquser1234
password: testpwd
Here is the error trace :
C:\inetpub\wwwroot\REDMIN~1>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
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:create
** Invoke environment (first_time)
** Execute environment
rake aborted!
Server name not found in configuration files
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds/client.rb:68:in `connect'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds/client.rb:68:in `initialize'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-sqlserver-adapter-3.2.12/lib/active_record/connection_adapters/sqlserver_adapter.rb:417:in `new'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-sqlserver-adapter-3.2.12/lib/active_record/connection_adapters/sqlserver_adapter.rb:417:in `connect'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-sqlserver-adapter-3.2.12/lib/active_record/connection_adapters/sqlserver_adapter.rb:204:in `initialize'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-sqlserver-adapter-3.2.12/lib/active_record/connection_adapters/sqlserver_adapter.rb:40:in `new'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-sqlserver-adapter-3.2.12/lib/active_record/connection_adapters/sqlserver_adapter.rb:40:in `sqlserver_connection'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
C:/Ruby19/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
C:/Ruby19/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:223:in `table_exists?'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/attribute_methods/primary_key.rb:75:in `get_primary_key'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/attribute_methods/primary_key.rb:60:in `reset_primary_key'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/attribute_methods/primary_key.rb:49:in `primary_key'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activerecord-3.2.13/lib/active_record/attribute_assignment.rb:13:in `attributes_protected_by_default'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:216:in `block in protected_attributes_configs'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:188:in `yield'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:188:in `default'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:188:in `protected_attributes'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:118:in `block in attr_protected'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:117:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:117:in `attr_protected'
C:/inetpub/wwwroot/redmine-test/app/models/issue_relation.rb:73:in `<class:IssueRelation>'
C:/inetpub/wwwroot/redmine-test/app/models/issue_relation.rb:18:in `<top (required)>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:469:in `load'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:469:in `block in load_file'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:639:in `new_constants_in'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:468:in `load_file'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:353:in `require_or_load'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:502:in `load_missing_constant'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:514:in `load_missing_constant'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:514:in `load_missing_constant'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:514:in `load_missing_constant'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing'
C:/inetpub/wwwroot/redmine-test/lib/redmine/helpers/gantt.rb:28:in `<class:Gantt>'
C:/inetpub/wwwroot/redmine-test/lib/redmine/helpers/gantt.rb:21:in `<module:Helpers>'
C:/inetpub/wwwroot/redmine-test/lib/redmine/helpers/gantt.rb:19:in `<module:Redmine>'
C:/inetpub/wwwroot/redmine-test/lib/redmine/helpers/gantt.rb:18:in `<top (required)>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
C:/inetpub/wwwroot/redmine-test/lib/redmine.rb:51:in `<top (required)>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
C:/inetpub/wwwroot/redmine-test/config/initializers/30-redmine.rb:4:in `<top (required)>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/engine.rb:587:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/engine.rb:587:in `block in <class:Engine>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
C:/inetpub/wwwroot/redmine-test/config/environment.rb:14:in `<top (required)>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
C:/Ruby19/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
C:/Ruby19/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
C:/Ruby19/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/bin/rake:23:in `load'
C:/inetpub/wwwroot/REDMIN~1/GEM_HOME/bin/rake:23:in `<main>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => environment
My first advice is to address this issue to support#helicontech.com.
And please clarify the following points:
the error is "Server name not found in configuration files", which means that Zoo is working but something is wrong with database connection, so
make sure that "rake db:setup --trace" is executed from Zoo console tun from manager.
make sure that in web.config you have
read the docs to tiny_tds https://github.com/rails-sqlserver/tiny_tds
:dataserver - Can be the name for your data server as defined in freetds.conf. Raw hostname or hostname:port will work here too. FreeTDS says that named instance like 'localhost\SQLEXPRESS' work too, but I highly suggest that you use the :host and :port options below. Google how to find your host port if you are using named instances or go here.
Yesterday an unwelcomed visitor was mucking around my server. I since rebooted ubuntu and changed passwords. Now I try to deploy my rails application and I am getting an error.
Here is the important part:
** [out :: 172.27.12.xxx] /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby /usr/local/rvm/gems/ruby-1.9.3-p392/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
** [out :: 172.27.12.xxx] /usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby /usr/local/rvm/gems/ruby-1.9.3-p327/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
** [out :: 172.27.12.xxx] /usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby /usr/local/rvm/gems/ruby-1.9.3-p327#global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
*** [deploy:update_code] rolling back
* executing "rm -rf /home/guarddog/public_html/guarddog.com/releases/20131220150214; true"
servers: ["172.27.12.xxx", "172.27.12.xxx", "172.27.12.xxx"]
** [deploy:update_code] exception while rolling back: IOError, closed stream
This is stack trace of error:
Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.6.2/lib/net/ssh/buffered_io.rb:65:in `recv': Operation timed out - recvfrom(2) (Errno::ETIMEDOUT)
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.6.2/lib/net/ssh/buffered_io.rb:65:in `fill'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.6.2/lib/net/ssh/connection/session.rb:228:in `block in postprocess'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.6.2/lib/net/ssh/connection/session.rb:224:in `each'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.6.2/lib/net/ssh/connection/session.rb:224:in `postprocess'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/processable.rb:31:in `block in process_iteration'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/processable.rb:43:in `block in ensure_each_session'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/processable.rb:41:in `each'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/processable.rb:41:in `ensure_each_session'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/processable.rb:29:in `process_iteration'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/command.rb:165:in `block (2 levels) in process!'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/command.rb:164:in `loop'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/command.rb:164:in `block in process!'
from /Users/guarddog/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/command.rb:163:in `process!'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/command.rb:134:in `process'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/actions/invocation.rb:185:in `block in run_tree'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/connections.rb:198:in `block in execute_on_servers'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/connections.rb:186:in `each'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/connections.rb:186:in `each_slice'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/connections.rb:186:in `execute_on_servers'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/actions/invocation.rb:183:in `run_tree'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/actions/invocation.rb:155:in `run'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from ./config/deploy.rb:77:in `block (2 levels) in load'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/callback.rb:38:in `call'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/callbacks.rb:141:in `block in trigger'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/callbacks.rb:141:in `each'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/callbacks.rb:141:in `trigger'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/callbacks.rb:27:in `invoke_task_directly_with_callbacks'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/recipes/deploy.rb:228:in `block (3 levels) in load'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:56:in `transaction'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/recipes/deploy.rb:227:in `block (2 levels) in load'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/recipes/deploy.rb:195:in `block (2 levels) in load'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/cli/execute.rb:45:in `each'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/cli/execute.rb:34:in `execute!'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.13.5/bin/cap:4:in `<top (required)>'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `load'
from /Users/guarddog/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `<main>'
I think the notable part is this line:
from ./config/deploy.rb:77:in `block (2 levels) in load'
That's actual code in my deploy.rb file:
task :precompile, :role => :app do
run "cd #{release_path}/ && RAILS_ENV=production bundle exec rake assets:precompile"
end
which is executed because of this line in my deploy.rb:
after "deploy:update_code", "deploy:precompile"
Note the deploys were working fine until the incident happened yesterday. He seemed to clone the git repository and copy it somewhere. But he didn't seem to delete any files.
Any idea why deploy:precompile gives the error?
It sounds like your remote codebase may have been compromised. I suggest using
cap deploy:check
cap deploy:cleanup
cap deploy:cold
to redeploy a fresh copy of your original codebase.
This will not modify your remote database, but it will restart the remote httpd server so, as with any deploy, you should wait until a suitable maintenance window to try it.
I am having difficulties troubleshooting the following and figuring out why my assets are failing to precompile at slug compilation... the odd thing is, is that the assets compile fine at runtime when I check the live logs... any ideas? Is it trying to connect to the database?
Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
undefined method `match' for nil:NilClass
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/mongo_uri.rb:49:in `initialize'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:104:in `new'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:104:in `parse'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:62:in `create_session'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:43:in `default'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions.rb:109:in `default'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid.rb:129:in `default_session'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/railtie.rb:131:in `block (2 levels) in <class:Railtie>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:34:in `call'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `each'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application/finisher.rb:59:in `block in <module:Finisher>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/config/environment.rb:5:in `<top (required)>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
Check whether your asset precompile requires access to ENV variables during when its run. Its hard to tell from your stack trace, but this might be a good resource to check out: https://devcenter.heroku.com/articles/rails-asset-pipeline
Essentially, you can enable the user-env-compile labs feature on heroku to give your app instance access to ENV vars during your precompile.
heroku labs:enable user-env-compile -a myapp
more information about that here: https://devcenter.heroku.com/articles/labs-user-env-compile
I had just added Unicorn, I added the following to my application.rb in config and was able to precompile:
config.assets.initialize_on_precompile = false
I'm attempting to debug why my application is attempting to connect to my database when I run rake assets:precompile --trace.
I'm probably missing something in the stack trace...anyone see the pertinent line?
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionController::Base instead. (called from <top (required)> at /Users/Kyle/Desktop/skateparks-web/config/application.rb:4)
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActionController::Base instead. (called from <top (required)> at /Users/Kyle/Desktop/skateparks-web/config/application.rb:4)
** 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!
FATAL: database "skateparks_production" does not exist
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `initialize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `new'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `connect'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:316:in `initialize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `new'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `postgresql_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/model_schema.rb:308:in `clear_cache!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activerecord-3.2.0/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:418:in `_run__2041913228368879189__prepare__1991931652306887621__callbacks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application/finisher.rb:48:in `block in <module:Finisher>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/Kyle/Desktop/skateparks-web/config/environment.rb:5:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/railties-3.2.0/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:89:in `block (2 levels) in <top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:56:in `block (3 levels) in <top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `load'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `<main>'
Tasks: TOP => environment
rake aborted!
Command failed with status (1): [/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/bi...]
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `sh'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `sh'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils.rb:78:in `ruby'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `ruby'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:9:in `ruby_rake_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/actionpack-3.2.0/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `load'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290#skateparks/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile
rake assets:precompile initializes your app by default, which includes connection to the database.
Inside config/application.rb you can add this, but see the link below for warnings about it:
config.assets.initialize_on_precompile = false
Rails Guide on Precompiling Assets
I had that same problem. After updating Sprockets to version 3, whenever I tried to precompile the assets locally (development), however using the settings of the production environment, I had this error:
rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add gem 'pg' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
Because in my local (development) I use MySQL and in the server (production), I use Postgres.
The answer marked as resolved does not work for me, because config.assets.initialize_on_precompile is not available in Rails 4.2.1.
To solve, I followed 3 simple steps:
In your Gemfile, add: gem "activerecord-nulldb-adapter"
In database.yml, change the adapter as follow:
production:
adapter: <%= ENV['DB_ADAPTER'] ||= 'postgresql' %>
To compile your production assets locally. run in your terminal
DB_ADAPTER=nulldb RAILS_ENV=production rake assets:precompile
This solutions solved to me and I sawyed here.
Newer versions of Rails do not load the database during asset precompile. However, initializers will often cause it to load. This can be frustrating to debug, because the error omits the stack trace.
./bin/rails assets:precompile
(in ~/src/nautilus)
rake aborted!
ActiveRecord::NoDatabaseError: FATAL: database "your_app_development" does not exist
bundler: failed to load command: rake (~/src/your_app/vendor/bundle/ruby/2.6.0/bin/rake)
NoMethodError: undefined method `reject' for nil:NilClass
The less than helpful error.
So, how do we figure out where the problem is?
Move all the initializers out of config/initializers then run ./bin/rails assets:precompile.
If it works, great, you know the problem is in one of those files.
Move them back one by one till you find the offending file(s).
Now that the problem was found, how do we fix it?
Then when I find an initialilzer that has a problem I wrap it with the following check:
unless ARGV.include? "assets:precompile"
# ...
end
I prefer this over the nulldb because it reduces the number of dependencies I have to maintain in the app.
If it makes sense in your situation, you can choose against which environment assets:precompile should work, with the following command:
rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets
This make sense for my deployment because usually:
I make rake to generates assets on my development machine (because the memory of my vps is somehow limited)
I zip all the application with the assets generated in public/assets
I transfer the zip to the vps ans unzip the package there
Hope it helps.
Check your configuration files (in all environments). If for example
rake assets:precompile
works in development, but you are having issues in production
RAILS_ENV=production bundle exec rake assets:precompile
then you most likely have a reference to active record in your /config/environments/production.rb
config.active_record.dump_schema_after_migration = false
In order to avoid that altogether if you are planning on not taking advantage of active record or employing a NoSQL such as mongo, you may wish to initialize your new app as follows:
rails new myApp --skip-active-record
which is equivalent to -O (capital O) as far as I am concerned.
Maybe this won't work for all cases but I was able to avoid Rails attempting to connect to the database on the rake assets:* tasks by surrounding the code in some places with the snippet below on the /config/routes.rb:
unless defined?(::Rake::SprocketsTask)
devise_for ...
#...
end
devise_scope ...
#...
end
end
Sometimes code which depends on external services or environment variables will get loaded because of code on the initializer files which are not required for assets to be precompiled.
I've recently faced a similar issue and the responses above didn't work for me. I've found the file on config/initializers/ that was causing the issue and wrapped it with the following code:
unless defined?(::Rake::SprocketsTask)
#...
end
The snippet above will skip the code within it when running rake assets:precompile or others like rake assets:clean as well.
Hopefully this will help others in the future!