We recently started having trouble with chef-client dying in the middle of a run after taking a lot more time stuck on various parts of the run-list that normally proceeded much quicker. I've been on my home wifi and my colleague has been on the work wifi, which has been having some connectivity problems of its own.
If your ssh connection gets interrupted to a machine while chef-client is running, does that crash the run in seemingly inexplicable ways? I am using PutTY to connect from my Win7 and my colleague is using the Apple Terminal App.
All the machines we've been running this on are Ubuntu 12.04 (in EC2) and have plenty of disk space left over - they're only utilizing ~1GB with ~5GB free.
Here is the output of the log from /var/log/chef/client.log (set with the log_location directive in /etc/chef/client.rb as described here).
[2014-01-08T00:27:07+00:00] WARN: Nodejs user is nodejs
[2014-01-08T00:27:07+00:00] WARN: Cloning resource attributes for group[nodejs] from prior resource (CHEF-3694)
[2014-01-08T00:27:07+00:00] WARN: Previous group[nodejs]: /var/chef/cache/cookbooks/nodejs/recipes/default.rb:26:in `from_file'
[2014-01-08T00:27:07+00:00] WARN: Current group[nodejs]: /var/chef/cache/cookbooks/spicoli-app/recipes/default.rb:38:in `from_file'
[2014-01-08T00:27:07+00:00] WARN: Cloning resource attributes for user[nodejs] from prior resource (CHEF-3694)
[2014-01-08T00:27:07+00:00] WARN: Previous user[nodejs]: /var/chef/cache/cookbooks/nodejs/recipes/default.rb:34:in `from_file'
[2014-01-08T00:27:07+00:00] WARN: Current user[nodejs]: /var/chef/cache/cookbooks/spicoli-app/recipes/default.rb:46:in `from_file'
[2014-01-08T00:27:30+00:00] WARN: Environment is _default
[2014-01-08T00:27:30+00:00] WARN: Nodejs user is nodejs
[2014-01-08T02:04:54+00:00] ERROR: Running exception handlers
[2014-01-08T02:04:54+00:00] ERROR: Exception handlers complete
[2014-01-08T02:04:54+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-01-08T02:04:55+00:00] ERROR: Input/output error - <STDOUT>
[2014-01-08T02:04:57+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
And the error stacktrace just has this:
Generated at 2014-01-08 02:04:54 +0000
Errno::EIO: Input/output error - <STDOUT>
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/base.rb:91:in `write'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/base.rb:91:in `puts'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/base.rb:91:in `puts'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/error_descriptor.rb:61:in `display_section'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/error_descriptor.rb:44:in `block (2 levels) in display'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/error_descriptor.rb:43:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/error_descriptor.rb:43:in `block in display'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/error_descriptor.rb:42:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/error_descriptor.rb:42:in `display'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/base.rb:130:in `display_error'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/base.rb:161:in `resource_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/formatters/doc.rb:159:in `resource_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/event_dispatch/dispatcher.rb:29:in `block in resource_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/event_dispatch/dispatcher.rb:29:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/event_dispatch/dispatcher.rb:29:in `resource_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource.rb:637:in `rescue in run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource.rb:643:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/runner.rb:81:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/runner.rb:81:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/runner.rb:80:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/client.rb:433:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/client.rb:500:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/client.rb:199:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/client.rb:193:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/client.rb:193:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/application.rb:208:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/application/client.rb:312:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/application/client.rb:304:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/application/client.rb:304:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/application.rb:66:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:23:in `load'
/usr/bin/chef-client:23:in `<main>'
Which is a really generic error! But it does seem to indicate an interruption to STDOUT output, which kind of makes sense with a client disconnection.
Edit: As requested, here are the contents of the client.rb file (names obfuscated, naturally.)
$ cat /etc/chef/client.rb
log_level :auto
log_location "/var/log/chef/client.log"
chef_server_url "https://api.opscode.com/organizations/myapp"
validation_client_name "my-validator"
node_name "my-app-node"
Edit 2: Attempt using sudo su -s /bin/bash root -c "screen chef-client"
Screen terminated while I was at lunch and recorded a timeout on the ShellOut command for npm install. This was after chef-client was sitting stuck on this operation for over an hour.
[2014-01-09T16:39:07+00:00] WARN: Environment is _default
[2014-01-09T16:39:07+00:00] WARN: Nodejs user is nodejs
[2014-01-09T18:16:28+00:00] ERROR: Running exception handlers
[2014-01-09T18:16:28+00:00] ERROR: Exception handlers complete
[2014-01-09T18:16:28+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-01-09T18:16:31+00:00] ERROR: execute[npm-install-app] (spicoli-app::default line 110) had an error: Mixlib::ShellOut::CommandTimeout: command timed out:
---- Begin output of npm --registry http://my.npm.repo.amazonaws.com:5984/registry/_design/app/_rewrite install --cache /home/nodejs/.npm --tmp /home/nodejs/tmp
--- snip: install messages from npm ---
[2014-01-09T18:16:33+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
This is a totally different error than before. The stacktrace.out file also explicitly mentions ShellOut, so it is entirely different as well. Most oddly, when I run the same npm command from the command line, in finishes in under a minute.
So I'm not sure there is a way to further diagnose the previous failure, but I would welcome other suggestions. For input on this new failure, I asked this followup question.
If your ssh connection gets interrupted to a machine while chef-client is running, does that crash the run in seemingly inexplicable ways?
Well, the stacktrace seems to imply that something like that is happening. The message says "Errno::EIO: Input/output error - <STDOUT>" which is consistent with what I'd expect to see if STDOUT was going over an SSH channel that had been closed.
I suggest 2 things:
Run chef-client with all console output redirected to a file; e.g. add > /tmp/log 2>&1 to the end of the command. (The redirection needs to happen on the remote machine.)
Add -l debug to the command to increase the level of logging, as covered in Opscode's technical FAQ. This could reveal clues that are currently being hidden.
Looking at your second update, this has the hallmarks of some kind of firewall or network related problem.
Related
I wanted to contribute to WordPress so I needed to install wordpress meta environment. I am installing VVV using this link. I have already installed Oracle VM VirtualBox.
At first installation everything went fine and I was able to use the local.wordpress.test site. I made some tweaks and messed up this url. Unable to solve this, I decided to reiterate the entire installation of VVV. I ran "vagrant up" command, this time everything goes fine, until at last I receive this message
==> default: Running provisioner: shell...
default: Running: inline script
default: * Restarting nginx nginx
default: ...done.
==> default: Running triggers after up...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/home/andys/.vagrant.d/gems/2.4.4/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/dsl.rb:90:in `method_missing': undefined method `name=' for #<VagrantPlugins::Triggers::DSL:0x0000000003911268> (NoMethodError)
from /home/andys/vagrant-local/Vagrantfile:525:in `block (2 levels) in <top (required)>'
from /home/andys/.vagrant.d/gems/2.4.4/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/dsl.rb:11:in `instance_eval'
from /home/andys/.vagrant.d/gems/2.4.4/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/dsl.rb:11:in `fire!'
from /home/andys/.vagrant.d/gems/2.4.4/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:52:in `block in fire_triggers'
from /home/andys/.vagrant.d/gems/2.4.4/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:51:in `each'
from /home/andys/.vagrant.d/gems/2.4.4/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:51:in `fire_triggers'
from /home/andys/.vagrant.d/gems/2.4.4/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:18:in `call'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/machine.rb:239:in `action_raw'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/machine.rb:208:in `block in action'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/environment.rb:598:in `lock'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/machine.rb:194:in `call'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/machine.rb:194:in `action'
from /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
Everything gets created initially, I can see an entry in VM VirtualBox as well. But at last this appears on my terminal and every progress done so far is deleted. I am stuck with this a complete day. I tried many possibilities and couldn't find a solution. Finally I decided to ask here.
I just want to complete my vagrant installation smoothly. Please help me to prevent "vagrant up" from auto destroying the created VM user.I would be very grateful and open to any suggestions.
Thanks!!
I am trying to install Gitlab CE from source and following this installation guide.
When I attempt to install the gitlab-shell using the command provided.
sudo -u git -H bundle exec rake gitlab:shell:install REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production SKIP_STORAGE_VALIDATION=true
I received the following stack trace error.
WARNING: This version of GitLab depends on gitlab-shell 4.1.1, but you're running Unknown. Please update gitlab-shell.
rake aborted!
Gitlab::TaskFailedError: Gitlab::TaskFailedError
/home/git/gitlab/lib/tasks/gitlab/task_helpers.rb:87:in `run_command!'
/home/git/gitlab/lib/tasks/gitlab/task_helpers.rb:164:in `clone_repo'
/home/git/gitlab/lib/tasks/gitlab/task_helpers.rb:157:in `checkout_or_clone_tag'
/home/git/gitlab/lib/tasks/gitlab/shell.rake:16:in `block (3 levels) in <top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Tasks: TOP => gitlab:shell:install
What config file should I be modifying to fix my issue? Do I need to modify the Redis URL even though I am using the default configuration? By the way, this install is on an Ubuntu 16.04 server.
This might be caused by using a version of git that is too old.
To debug: append the --trace option to bundle exec to get more info on where this error is coming from and inspect the source.
I am trying to run Siriproxy on a fresh Raspberry Pi.
I have followed this tutorial step by step: http://www.hometoys.com/emagazine.php?art_id=2090
Everything looked to install 100%. But on the last step I tried to run 'rvmsudo siriproxy server' I get this error below.
siri#raspberrypi:~/SiriProxy$ rvmsudo siriproxy server
/home/siri/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych.rb:297:in `initialize': No such file or directory - /root/.siriproxy/config.ym l (Errno::ENOENT)
from /home/siri/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych.rb:297:in `open'
from /home/siri/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych.rb:297:in `load_file'
from /home/siri/.rvm/gems/ruby-1.9.3-p385#SiriProxy/gems/siriproxy-0.3.3/lib/siriproxy/command_line.rb:143:in `parse_options'
from /home/siri/.rvm/gems/ruby-1.9.3-p385#SiriProxy/gems/siriproxy-0.3.3/lib/siriproxy/command_line.rb:33:in `initialize'
from /home/siri/.rvm/gems/ruby-1.9.3-p385#SiriProxy/gems/siriproxy-0.3.3/bin/siriproxy:6:in `new'
from /home/siri/.rvm/gems/ruby-1.9.3-p385#SiriProxy/gems/siriproxy-0.3.3/bin/siriproxy:6:in `<top (required)>'
from /home/siri/.rvm/gems/ruby-1.9.3-p385#SiriProxy/bin/siriproxy:23:in `load'
from /home/siri/.rvm/gems/ruby-1.9.3-p385#SiriProxy/bin/siriproxy:23:in `<main>'
It seems like when you ran the sections involving cp ~/SiriProxy/config.example.yml ~/.siriproxy/config.yml you created these directories in your user directory, not in the root directory where it is looking. The ~/ symbol is shorthand for a home directory. Try learning how basic linux navigation works and matching up where your config.yml files should be stored-- e.g., root vs user directories.
All:
My error logs show heroku crashing on a rake task, rake jobs:work.
The problem is, I don't have a rake task called jobs or work. I only have one, called cron.
In that task, there's no Delayed Job stuff at all, and nowhere does the word 'jobs' or 'work' appear.
I've also looked in the Config files, and no trace of anything about Delayed Job. It's also not in Vendor/plugins.
Any ideas where the hidden rake task might be?
here's the error code:
2012-01-03T20:28:45+00:00 heroku[worker.3]: State changed from crashed to created
2012-01-03T20:28:45+00:00 heroku[worker.3]: State changed from created to starting
2012-01-03T20:28:48+00:00 heroku[worker.3]: Starting process with command `rake jobs:work`
2012-01-03T20:28:48+00:00 app[worker.3]: (in /app)
2012-01-03T20:28:48+00:00 heroku[worker.3]: State changed from starting to up
2012-01-03T20:28:49+00:00 app[worker.3]: rake aborted!
2012-01-03T20:28:49+00:00 app[worker.3]: Don't know how to build task 'jobs:work'
2012-01-03T20:28:49+00:00 app[worker.3]:
2012-01-03T20:28:49+00:00 app[worker.3]: (See full trace by running task with --trace)
2012-01-03T20:28:50+00:00 heroku[worker.3]: State changed from up to crashed
2012-01-03T20:28:51+00:00 heroku[worker.3]: Process exited
2012-01-03T20:28:53+00:00 app[web.9]:
Here's the --trace code
MacBook-Air:patientapp dougsmith$ heroku rake jobs:work --trace
(in /app)
rake aborted!
Don't know how to build task 'jobs:work'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/app/.bundle/gems/ruby/1.8/bin/rake:19:in `load'
/app/.bundle/gems/ruby/1.8/bin/rake:19
MacBook-Air:patientapp dougsmith$
Do you have 1 or more Heroku worker dyno/s configured?
Looks like Heroku default Procfile run the command
worker bundle exec rake jobs:work
for Rails apps. Probably, editing/creating a procfile without this command makes the trick.
More info:
https://devcenter.heroku.com/articles/procfile
This happened to me. I found that delayed job had been in use before I started work on the site. A worker dyno was still configured for it. After removing that dyno the error went away.
Recently I upgraded my gems and started adding new stuff to my app like authentication by third party social websites using omniauth gem. On development environment everything is fine and works like a charm.
I am deploying to staging and production servers using capistrano. Basic deployment is fine and working so far, but I have got really strange problems when I want to do migrations when deploying.
I get the following error messages from capistrano:
[my.server.com] executing command
*** [err :: my.server.com] rake aborted!
*** [err :: my.server.com] "\xC5" on US-ASCII
*** [err :: my.server.com]
*** [err :: my.server.com] (See full trace by running task with --trace)
command finished in 2472ms
I was googling all around and couldn't find any relevant solution. I also tried to downgrade rake gem back to 0.8.7 but with no success on the end - the same errors.
After hours of googling and digging in I found the solution that (I hope) may by helpful for someone with a similar or the same problem.
I did bundle exec rake --trace db:migrate on the staging server and got the following error messages:
rake aborted!
"\xC5" on US-ASCII
/var/www/myapp/test.myapp.com/releases/20111230233802/config/application.rb:5:in `read'
/var/www/myapp/test.myapp.com/releases/20111230233802/config/application.rb:5:in `<top (required)>'
/var/www/myapp/test.myapp.com/releases/20111230233802/Rakefile:4:in `require'
/var/www/myapp/test.myapp.com/releases/20111230233802/Rakefile:4:in `<top (required)>'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/bin/rake:19:in `load'
/var/www/myapp/test.myapp.com/shared/bundle/ruby/1.9.1/bin/rake:19:in `<main>'
So I jumped in to the config/application.rb file to find out what could rise the error. Line 5 of that file loads an external config file:
require 'yaml'
APP_CONFIG = YAML.load(File.read(File.expand_path('../app_config.yml', __FILE__)))
and that external file contains UTF-8 chars, not US-ASCII. So I tried a couple of different solutions to solve that problem.
The only one which worked for me was to add an extra few lines of code on top of config/application.rb file:
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
just to tell rake to load external files using utf-8 encoding. After that change everything went smooth and exactly as expected. Problem solved!
PS.
I really don't know why developers of rake 0.9 have changed previous behavior of rake 0.8 which worked fine for me and probably for you as well for a long time. Maybe you have an idea why? I am very curious.