"rake aborted!" on "sudo bundle exec rake db:create" cmd (macOS M1)

Does anybody happen to have any ideas?
Great thanks for any help!

My guess is it probably database service isn’t running. Thus I would suggest to check that Psql is configured and running

3 Likes

Thx :coffee: I’m looking into it.

Hi, I’m checking the Psql, and find the service started:

Thanks!

This is because brew install postgresql was recently updated to brew install postgresql@14. I have updated the install script to reflect the same.

Running brew install postgresql@14 should fix this issue for you.

4 Likes

Hi Arpit, @techAPJ
Thanks for the reply! I’ve fixed this part and the SQL service is started:

However, I’m still having the issue, and I’ve added --trace to print more info.
Could you help have a look? Thanks!

MyUserName@Yans-MacBook-Pro install-rails % sudo bundle exec rake db:create --trace
(in /Users/MyUserName/discourse)
** Invoke db:create (first_time)
** Invoke db:force_skip_persist (first_time)
** Execute db:force_skip_persist
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
NameError: undefined method `call' for class `Redis::Client'
Did you mean?  caller
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rack-mini-profiler-3.0.0/lib/mini_profiler/profiling_methods.rb:83:in `alias_method'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rack-mini-profiler-3.0.0/lib/mini_profiler/profiling_methods.rb:83:in `profile_method'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rack-mini-profiler-3.0.0/lib/mini_profiler/profiling_methods.rb:65:in `counter_method'
/Users/MyUserName/discourse/config/initializers/006-mini_profiler.rb:87:in `<main>'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/engine.rb:667:in `load'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/engine.rb:667:in `block in load_config_initializer'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-7.0.3.1/lib/active_support/notifications.rb:208:in `instrument'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/engine.rb:666:in `load_config_initializer'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/engine.rb:619:in `each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/engine.rb:619:in `block in <class:Engine>'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in `instance_exec'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in `run'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:50:in `each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:50:in `tsort_each_child'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:415:in `call'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `call'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/initializable.rb:60:in `run_initializers'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/application.rb:372:in `initialize!'
/Users/MyUserName/discourse/config/environment.rb:7:in `<main>'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/application.rb:348:in `require_environment!'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/railties-7.0.3.1/lib/rails/application.rb:511:in `block in run_tasks_blocks'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/Users/MyUserName/.rbenv/versions/2.7.3/bin/rake:23:in `load'
/Users/MyUserName/.rbenv/versions/2.7.3/bin/rake:23:in `<top (required)>'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `load'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `kernel_load'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:23:in `run'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:486:in `exec'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:31:in `dispatch'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:25:in `start'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
/Users/MyUserName/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
/Users/MyUserName/.rbenv/versions/2.7.3/bin/bundle:25:in `load'
/Users/MyUserName/.rbenv/versions/2.7.3/bin/bundle:25:in `<main>'
Tasks: TOP => db:create => db:load_config => environment

Hi @techAPJ, @YAN!

Has anything happened with this? I’m facing the same problem now, trying to upgrade from (stable branch) 3.0.1 to 3.0.2. This is on RHEL8 which I have to use given the security policies in place.

I’ve also tried to switch to the tests-passed branch, but to no avail. Something tells me “this has to be a versioning issue”… is it possible to get a dump of the Gemfile.lock from a functional installation?

Should probably mention that this happens during rake db:migrate, not db:create as for @YAN

Cheers,
Stein Haugan

Update: pegging redis at 4.8.0 fixed the issue for me (see diff for Gemfile below). Since the version number was not specified in the Gemfile originally, I suspect that a clean install of 3.0.1 would show the same problem.

-gem "redis"
+gem "redis", "4.8.0"