I have installed Redmine 2.6.1-stable, it works using apache2 and passenger.
I'm trying to receive emails using imap with this two rakes:
this one:
rake -f /opt/redmine-2.6.1/Rakefile --silent redmine:email:receive_imap RAILS_ENV="production" host=smtp.yandex.ru port=465 username=mail#yandex.ru password=pwd ssl=true project=desk folder=INBOX move_on_success=processed move_on_failure=failed no_permission_check=1 unknown_user=accept
And this one:
bundle exec rake redmine:email:receive_imap host='smtp.yandex.ru' username='mail#yandex.ru' password='pwd' port=465 ssl=true starttls=true allow_override=type,project project=desk
And this is log:
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
EOFError: end of file reached
/home/admin/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/imap.rb:1150:in `get_tagged_response'
/home/admin/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/imap.rb:1210:in `block in send_command'
/home/admin/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/admin/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/imap.rb:1192:in `send_command'
/home/admin/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/imap.rb:435:in `login'
/opt/redmine-2.6.1/lib/redmine/imap.rb:30:in `check'
/opt/redmine-2.6.1/lib/tasks/email.rake:128:in `block (4 levels) in <top (required)>'
/opt/redmine-2.6.1/app/models/mailer.rb:367:in `with_synched_deliveries'
/opt/redmine-2.6.1/lib/tasks/email.rake:127:in `block (3 levels) in <top (required)>'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/task.rb:240:in `call'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/task.rb:240:in `block in execute'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/task.rb:235:in `each'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/task.rb:235:in `execute'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/admin/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/task.rb:165:in `invoke'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:150:in `invoke_task'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:106:in `each'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:106:in `block in top_level'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:115:in `run_with_threads'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:100:in `top_level'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:78:in `block in run'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:176:in `standard_exception_handling'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/lib/rake/application.rb:75:in `run'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/gems/rake-10.5.0/bin/rake:33:in `<top (required)>'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/bin/rake:23:in `load'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/bin/rake:23:in `<main>'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/bin/ruby_executable_hooks:15:in `eval'
/home/admin/.rvm/gems/ruby-2.1.5#rails3/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => redmine:email:receive_imap
I can't understand what's going on.. Why it does not work properly?
Log /opt/redmine-2.6.1/logs/production.log is empty about this operation.
I recently solved my similar problem with enabling debug on IMAP, so I could see what's happened. To do that;
vim /var/www/redmine/lib/redmine/imap.rb
and after require 'net/imap' add this line:
Net::IMAP.debug = true
It usually relates to the login credentials/method.
You are trying to receive IMAP email from an SMTP server. These are completely different protocols.
Likely you want server imap.yandex.ru, Port 993, with SSL (not starttls).
Settings for IMAP appear to be available at https://yandex.com/support/mail/mail-clients.xml
Related
Deploying a Rails app to a new server, for the first time.
Running cap production deploy --trace gives me:
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
NoMethodError: undefined method `upcase' for nil:NilClass
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sshkit-1.14.0/lib/sshkit/configuration.rb:90:in `logger'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sshkit-1.14.0/lib/sshkit/configuration.rb:51:in `output_verbosity='
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/capistrano-3.9.0/lib/capistrano/configuration.rb:94:in `block in configure_backend'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sshkit-1.14.0/lib/sshkit.rb:11:in `configure'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/capistrano-3.9.0/lib/capistrano/configuration.rb:92:in `configure_backend'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/capistrano-3.9.0/lib/capistrano/setup.rb:32:in `block (2 levels) in <top (required)>'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/capistrano-3.9.0/lib/capistrano/application.rb:14:in `run'
/Users/dfaulken-af/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/capistrano-3.9.0/bin/cap:3:in `<top (required)>'
/Users/dfaulken-af/.rbenv/versions/2.4.1/bin/cap:22:in `load'
/Users/dfaulken-af/.rbenv/versions/2.4.1/bin/cap:22:in `<main>'
Tasks: TOP => production
Which seems entirely confined to gem code. Before I open an issue with them (sshkit?), has anyone seen this before?
I use Net::SSH::Config to get the SSH user from my SSH config file. I know that those settings are correct, as I'm able to use them to log into the server.
remote_user = Net::SSH::Config.for('50.198.83.200')[:user] || ENV['USER']
server '50.198.83.200', user: remote_user, roles: %w(app db web)
But I've tried setting the remote user with USER=the_user_name cap, etc. and still get the same error.
My log_level line was incompletely written as
set :log_level
With no second argument.
I am running rails 4.2 and have set up a rake task to send an email but get this error when I run the rake task:
** Invoke send_report_email (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute send_report_email
production
rake aborted!
OpenSSL::SSL::SSLError: hostname "localhost" does not match the server certificate
/usr/lib/ruby/2.2.0/openssl/ssl.rb:240:in `post_connection_check'
/usr/lib/ruby/2.2.0/net/smtp.rb:588:in `tlsconnect'
/usr/lib/ruby/2.2.0/net/smtp.rb:563:in `do_start'
/usr/lib/ruby/2.2.0/net/smtp.rb:520:in `start'
/var/lib/gems/2.2.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
/var/lib/gems/2.2.0/gems/mail-2.6.3/lib/mail/message.rb:252:in `deliver!'
/var/lib/gems/2.2.0/gems/actionmailer-4.2.3/lib/action_mailer/message_delivery.rb:77:in `deliver_now!'
/var/lib/gems/2.2.0/gems/actionmailer-4.2.3/lib/action_mailer/message_delivery.rb:95:in `deliver!'
/path/to/app/lib/tasks/email_tasks.rake:4:in `block in <top (required)>'
/usr/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/usr/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/usr/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/usr/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/usr/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/usr/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/usr/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/usr/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/usr/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/usr/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/usr/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/usr/bin/rake:33:in `<main>'
Tasks: TOP => send_report_email
The line production is just me having a put ENV["RAILS_ENV"] in the rake task to make sure it is set to production
my /config/enviroments/production.rb
config.action_mailer_default_url_options = {host: "my.host.com"}
config.action_mailer_smtp_settings = {
enable_starttls_auto: false,
domain: 'my.host.com',
address: "my.host.com",
openssl_verify_mode: 'none'
}
When I ran apt-get install postfix I configured it also to use my.host.com and not localhost. Where is rails getting that localhost value from?
I'm trying to create a rake task that restarts my heroku servier. I've found this post, which has helped immensely: http://railspikes.com/2010/2/13/rake-task-for-deploying-to-heroku.
I've cobbled together this rake task, but it's giving me an error. The rake abouts and I get the message:
uninitialized constant Heroku::Command::BaseWithApp.
This is my method.
desc 'restarts the server'
task restart_server: :environment do
require 'heroku'
require 'heroku/command'
user, pass = File.read(File.expand_path("~/.heroku/credentials.txt")).split("\n")
heroku = Heroku::Client.new(user, pass)
cmd = Heroku::Command::BaseWithApp.new([])
remotes = cmd.git_remotes(File.dirname(__FILE__) + "/../..")
remote, app = remotes.detect {|key, value| value == (ENV['APP'])}# || cmd.app)}
if remote.nil?
raise "Could not find a git remote for the '#{ENV['APP']}' app"
end
heroku.restart(ENV['APP'])
end
I'm not sure why it's rejecting Heroku::Command. The app is already live on Heroku, so I know it's Heroku compliant.
Any advice?
EDIT: Here's my stack trace.
** Invoke restart_server (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute restart_server
rake aborted!
uninitialized constant Heroku::Command::BaseWithApp
/Users/bendowney/Sites/ProblemChildApp/lib/tasks/scheduler.rake:51:in `block in <top (required)>'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/bendowney/.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'
/Users/bendowney/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/bendowney/.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'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `load'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `<main>'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#ProblemChildApp/bin/ruby_noexec_wrapper:14:in `eval'
/Users/bendowney/.rvm/gems/ruby-1.9.3-p194#ProblemChildApp/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => restart_server
I'm having a similar problem to this gentleman here.
I've been trying to run a cucumber feature via a rake task. And I've been picking up the specified error in the title.
Here's a full backtrace. And my ruby version. (When I attempted to run the rails version command, I got "command not found".
$ rake features:all --trace
** Invoke features:all (first_time)
** Invoke features:watir_webdriver (first_time)
** Execute features:watir_webdriver
c:/Ruby193/bin/ruby -S bundle exec cucumber --profile watir
Using the watir profile...
No such file or directory - /dev/null (Errno::ENOENT)
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:34:in `initialize'
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:34:in `open'
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:34:in `initialize'
c:/Ruby193/lib/ruby/1.9.1/webrick/log.rb:124:in `initialize'
c:/code/page-object/features/sample-app/sample_app.rb:12:in `new'
c:/code/page-object/features/sample-app/sample_app.rb:12:in `start'
c:/code/page-object/features/support/ajax_text_environment.rb:6:in `block in run'
rake aborted!
Command failed with status (1): [c:/Ruby193/bin/ruby -S bundle exec cucumbe...]
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.1.9/lib/cucumber/rake/task.rb:104:in `run'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.1.9/lib/cucumber/rake/task.rb:193:in `block in define_task'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
c:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
c:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
c:/Ruby193/bin/rake:19:in `load'
c:/Ruby193/bin/rake:19:in `<main>'
Tasks: TOP => features:all => features:watir_webdriver
And ruby version
ruby -v
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
Any help would be infinitely appreciated. Thanks.
the dev/null was in config/initializers/quiet_assets and I replaced dev/null with logger.txt
if you are working on the same application on *nix and windows you could replace '/dev/null'
with RUBY_PLATFORM != 'i386-mingw32' ? '/dev/null' : 'NUL'
for me it was in quiet_assets.rb and I replaced
Rails.application.assets.logger = Logger.new('/dev/null')
with
Rails.application.assets.logger = Logger.new(RUBY_PLATFORM != 'i386-mingw32' ? '/dev/null' : 'NUL')
I actually figured it out. There was a configuration setting in the application I'm working on in one of the slightly obscured files. It set the path of the logger to "/dev/null". I just changed it to "logger.txt" and it works now.
So this problem is occurring for me on both RHEL5 and OSX Lion. Both environments are running 1.9.2-p290 ruby installed with RVM.
When I run the following command I get the following problem:
[master][~/Sites/boss-mocha] bundle exec rake db:data:load --trace
** Invoke db:data:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:load
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:85:in `load_records'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:74:in `load_table'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:63:in `block (2 levels) in load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:61:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:61:in `block in load_documents'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/deprecated.rb:30:in `each'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/deprecated.rb:30:in `load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:60:in `load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:57:in `block in load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:56:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:31:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/tasks/yaml_db_tasks.rake:35:in `block (3 levels) in <top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:data:load
The YAML being produced by rake db:data:dump appears mal-formed, with spurious "---"s between the "records" list and the actual records.
Removing the inappropriate "---" allows the data to load. I haven't created a pull request for the fix yet, but after tracking it down I noticed someone else reported it as an issue on github:
https://github.com/ludicast/yaml_db/issues/17
In addition, changing the YAML engine as in the link below produces correct output, eliminating the need for editing the file manually (or fixing yaml_db).
rails error, couldn't parse YAML