无法运行rake db:使用docker compose迁移

时间:2018-06-28 04:35:24

标签: docker-compose ruby-on-rails-5

我是docker的新手,并试图按照本教程learn docker

进行操作

尝试运行时出现以下错误

docker-compose run web rake db:create

我尝试删除DockerFile的入口点,但结果相同。谁能指出我做错了什么?

    /usr/local/bundle/gems/thor-0.20.0/lib/thor/base.rb:507:in `handle_argument_error': ERROR: "rails server" was called with arguments ["db:create"] (Thor::InvocationError)
Usage: "rails server [puma, thin etc] [options]"
    from /usr/local/bundle/gems/thor-0.20.0/lib/thor/command.rb:34:in `rescue in run'
    from /usr/local/bundle/gems/thor-0.20.0/lib/thor/command.rb:21:in `run'
    from /usr/local/bundle/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/bundle/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
    from /usr/local/bundle/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
    from /usr/local/bundle/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
    from /usr/local/bundle/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
    from /myapp/bin/rails:9:in `require'
    from /myapp/bin/rails:9:in `<top (required)>'
    from /usr/local/bundle/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
    from /usr/local/bundle/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
    from /usr/local/bundle/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
    from /usr/local/bundle/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
    from /usr/local/bundle/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
    from /usr/local/bundle/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
    from /usr/local/bundle/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
    from /myapp/bin/spring:15:in `require'
    from /myapp/bin/spring:15:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

1 个答案:

答案 0 :(得分:1)

迟到总比不到好。克隆git repo后,您想使用教程页面learn docker

中的Dockerfile替换Dockerfile。