Bug creating docker database
sbonaime opened this issue · 2 comments
sbonaime commented
Describe the bug
There is a problem for creating the database with docker :
To Reproduce
Steps to reproduce the behavior:
sudo docker-compose exec app rake db:setup --trace
rake aborted!
Gem::LoadError: You have already activated rake 12.3.0, but your Gemfile requires rake 13.0.1. Prepending `bundle exec` to your command may solve this.
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/runtime.rb:312:in `check_for_activated_spec!'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/runtime.rb:31:in `block in setup'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/spec_set.rb:147:in `each'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/spec_set.rb:147:in `each'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/runtime.rb:26:in `map'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/runtime.rb:26:in `setup'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler.rb:149:in `setup'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/setup.rb:10:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/ui/shell.rb:136:in `with_level'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/ui/shell.rb:88:in `silence'
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/setup.rb:10:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/fablabs/config/boot.rb:3:in `<top (required)>'
/fablabs/config/application.rb:1:in `require_relative'
/fablabs/config/application.rb:1:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/fablabs/Rakefile:4:in `<top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load_rakefile'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:703:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:104:in `block in load_rakefile'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:103:in `load_rakefile'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:82:in `block in run'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Expected behavior
Database creation
Desktop (please complete the following information):
- OS: fresh install of debian stretch
viktorsmari commented
Prepending
bundle exec
to your command may solve this.
Instead of:
sudo docker-compose exec app rake db:setup --trace
Does adding bundle exec
before rake
work?
sudo docker-compose exec app bundle exec rake db:setup --trace
sbonaime commented
In my case
sudo docker-compose exec app bundle exec rake db:setup --trace
solved the problem.
Thank you !