Getting error when trying to perform migrations on Mac OS X for development


(David O'Dea) #1

When I get to the stage whereby I should create DB in postgres, I get an error saying the role " " does not exist.

Anyone know what the issue is ?


Beginners Guide to Install Discourse on macOS for Development
(David O'Dea) #2

Not to worry, I needed to create another DB superuser with:

CREATE USER username SUPERUSER;


(David O'Dea) #3

I have ran bundle install successfully. However when I attempt to run:

bundle exec rake db:migrate db:test:prepare db:seed_fu

I then receive errors:

Kuyashis-MacBook-Pro:discourse Kuyashi$ bundle exec rake db:migrate db:test:prepare db:seed_fu
rake aborted!
LoadError: cannot load such file -- memory_profiler
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/Users/Kuyashi/discourse/config/initializers/006-mini_profiler.rb:7:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
/Users/Kuyashi/discourse/config/environment.rb:5:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/application.rb:328:in `require_environment!'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.7.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/Library/Ruby/Gems/2.0.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `load'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:24:in `run'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/cli.rb:304:in `exec'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/cli.rb:11:in `start'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/exe/bundle:27:in `block in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

Could anyone assist please ?


(Jay Pfaffman) #4

Hmm. Did you

 bundle install

?


(David O'Dea) #5

@pfaffman yes, when ran bundle install I got:

Bundle complete! 99 Gemfile dependencies, 185 gems now installed. Usebundle show [gemname]to see where a bundled gem is installed.


(David O'Dea) #6

… but that was before running:

bundle exec rake db:migrate db:test:prepare db:seed_fu

I still get the above error even though it says bundle completed …


(Arpit Jalan) #7

Try doing:

cd ~/discourse
source ~/.bashrc
bundle install
bundle exec rake db:migrate db:test:prepare db:seed_fu

(David O'Dea) #8

many thanks @techAPJ :wink: