command is finished, the container will stop. With it, the container will remain idle, which makes it easier to connect to it later (
docker exec -it container_name bash
).
tail -f /dev/null
is a command that runs endlessly and doesn't use any CPU because nothing can be read from
/dev/null
and we are asking for an endless read from it.
bundle exec rake db:create
使用数据库创建的时候出现报错,那么与远程数据库无法连接,查看.toos-versions
/home/linlin/.asdf/installs/ruby/2.6.9/lib/ruby/gems/2.6.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead. SCRAM authentication requires libpq version 10 or above /home/linlin/.asdf/installs/ruby/2.6.9/lib/ruby/gems/2.6.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize' /home/linlin/.asdf/installs/ruby/2.6.9/lib/ruby/gems/2.6.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
ruby 2.6.9
postgres 11.12
把数据库版本调整到10以上。
bundle
bundle exec rake db:create
还是报错
/home/linlin/.asdf/installs/ruby/2.6.9/lib/ruby/gems/2.6.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead. SCRAM authentication requires libpq version 10 or above
那么,进行删除rm Gemfile.lock
vim Gemfile
取消注释 source 'https://gems.ruby-china.com'
注释#source 'https://rubygems.org'
再次进行创建
bundle exec rake db:create
/home/linlin/.asdf/installs/ruby/2.6.9/lib/ruby/gems/2.6.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.