Gitlab rake gitlab:check fails on Mountain Lion Server - ruby-on-rails

I'm trying to install Gitlab on an 10.8.2 Server but when I execute
bundle exec rake gitlab:check RAILS_ENV=production
I'm getting the following error.
Checking Environment ...
gitlab user is in gitg group? ... yes
Has no "-e" in ~gitolite/.profile ... yes
Git configured for gitlab user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
** Invoke gitlab:gitolite:check (first_time)
** Invoke environment
** Execute gitlab:gitolite:check
Checking Gitolite ...
Using recommended version ... no
Try fixing it:
We strongly recommend using the version pointed out in the installation guide.
For more information see:
doc/install/installation.md in section "Gitolite"
Repo umask is 0007 in .gitolite.rc? ... yes
Allow all Git config keys in .gitolite.rc ... yes
Config directory exists? ... yes
Config directory owned by gitolite:gitg ... rake aborted!
undefined method `split' for nil:NilClass
/Users/gitlab/Opt/rails/gitlabhq/lib/tasks/gitlab/task_helpers.rake:81:in `gid_for'
/Users/gitlab/Opt/rails/gitlabhq/lib/tasks/gitlab/check.rake:533:in `check_dot_gitolite_user_and_group'
/Users/gitlab/Opt/rails/gitlabhq/lib/tasks/gitlab/check.rake:400:in `block (3 levels) in <top (required)>'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/gitlab/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:187:in `block in invoke_prerequisites'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:185:in `each'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:185:in `invoke_prerequisites'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:165:in `block in invoke_with_call_chain'
/Users/gitlab/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/bin/rake:19:in `load'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374#global/bin/rake:19:in `<main>'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval'
/Users/gitlab/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `<main>'
I literally checked the permissions a thousand time, if anyone can get me a hint on the problem this would be great.

This seems to be an issue in progress: see Issue 2890.
The commit e0d62d9c might fix this problem, in lib/tasks/gitlab/task_helpers.rake.
def gid_for(group_name)
- group_line = File.read("/etc/group").lines.select{|l| l.start_with?("#{group_name}:")}.first
- group_line.split(":")[2].to_i
+ Etc.getgrnam(group_name).gid
end

Related

Deploying Rails with Capistrano, undefined method upcase for nil

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.

Redmine receiving emails from imap

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

No such file or directory - /dev/null (Errno::ENOENT)

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.

rake assets:precompile attempting to connect to database

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!

YAML DB won't run due to evaluating nil.each

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

Resources