- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试获取 webpacker
与 docker
合作, puma 3.10.0
, rails 5.1.4
, 和 webpacker 3.0.1
.
我为 docker 设置了以下配置:
Dockerfile
FROM ruby:2.4.1
ENV DIR=/app \
BUNDLE_JOBS=4
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs openssl yarn
RUN mkdir $DIR
WORKDIR $DIR
ADD Gemfile $DIR/Gemfile
ADD Gemfile.lock $DIR/Gemfile.lock
RUN bundle install
RUN gem install foreman
ADD . $DIR
EXPOSE 3000
ADD docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD bundle exec rails s -p 3000 -b 0.0.0.0
version: "2"
services:
db:
image: postgres
env_file:
- docker.env
webpacker:
build: .
command: bundle exec bin/webpack-dev-server
ports:
- "8080:8080"
app:
build: .
links:
- db:db
ports:
- "3000:3000"
depends_on:
- db
- webpacker
env_file:
- docker.env
command: bundle exec rails s -p 3000 -b '0.0.0.0'
docker-compose up
并访问
localhost:3000
,我收到以下错误:
#<Errno::EADDRNOTAVAIL: Cannot assign requested address - connect(2) for [::1]:3035>
webpacker_1 |
webpacker_1 | Project is running at http://localhost:3035/
webpacker_1 | webpack output is served from /packs/
webpacker_1 | Content not from webpack is served from /app/public/packs
webpacker_1 | 404s will fallback to /index.html
webpacker_1 | Running /app/node_modules/.bin/elm-make /app/app/javascript/packs/Main.elm --yes --warn --debug --output /tmp/117813-1-17kg4e0.13yc01wcdi.js
webpacker_1 | 14% building modules 40/57 Success! Compiled 1 module./lib/transport/xhr-streaming.js
webpacker_1 | Successfully generated /tmp/117813-1-17kg4e0.13yc01wcdi.js
webpacker_1 |
94% asset optimHash: 0fba3c9f83d08f099017
webpacker_1 | Version: webpack 3.5.6
webpacker_1 | Time: 4214ms
webpacker_1 | Asset Size Chunks Chunk Names
webpacker_1 | hello_elm-a49ad0a3ed48411416eb.js 1.87 MB 0 [emitted] [big] hello_elm
webpacker_1 | Main-f0a26307d1db1882a32b.js 1.87 MB 1 [emitted] [big] Main
webpacker_1 | application-963cd78993444428f61c.js 896 kB 2 [emitted] [big] application
webpacker_1 | manifest.json 182 bytes [emitted]
webpacker_1 | [34] (webpack)-dev-server/client?http://localhost:3035 5.83 kB {0} {1} {2} [built]
webpacker_1 | [35] ./node_modules/url/url.js 23.3 kB {0} {1} {2} [built]
webpacker_1 | [41] ./node_modules/strip-ansi/index.js 161 bytes {0} {1} {2} [built]
webpacker_1 | [43] ./node_modules/loglevel/lib/loglevel.js 7.74 kB {0} {1} {2} [built]
webpacker_1 | [44] (webpack)-dev-server/client/socket.js 856 bytes {0} {1} {2} [built]
webpacker_1 | [45] ./node_modules/sockjs-client/lib/entry.js 244 bytes {0} {1} {2} [built]
webpacker_1 | [77] (webpack)-dev-server/client/overlay.js 3.6 kB {0} {1} {2} [built]
webpacker_1 | [82] (webpack)/hot nonrecursive ^\.\/log$ 170 bytes {0} {1} {2} [built]
webpacker_1 | [84] (webpack)/hot/emitter.js 77 bytes {0} {1} {2} [built]
webpacker_1 | [86] ./app/javascript/packs/Main.elm 335 kB {0} {1} [built]
webpacker_1 | [87] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/application.js 40 bytes {2} [built]
webpacker_1 | [88] ./app/javascript/packs/application.js 515 bytes {2} [built]
webpacker_1 | [89] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/hello_elm.js 40 bytes {0} [built]
webpacker_1 | [90] ./app/javascript/packs/hello_elm.js 396 bytes {0} [built]
webpacker_1 | [91] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/Main.elm 40 bytes {1} [built]
webpacker_1 | + 77 hidden modules
webpacker_1 | webpack: Compiled successfully.
webpacker_1 | Project is running at http://localhost:3035/
webpacker_1 | webpack output is served from /packs/
webpacker_1 | Content not from webpack is served from /app/public/packs
webpacker_1 | 404s will fallback to /index.html
webpacker_1 | Running /app/node_modules/.bin/elm-make /app/app/javascript/packs/Main.elm --yes --warn --debug --output /tmp/117813-1-1lm55js.r9mkgzm2t9.js
webpacker_1 | 14% building modules 40/57 modules 17 active ...ockjsSuccess! Compiled 1 module.et.js
webpacker_1 | Successfully generated /tmp/117813-1-1lm55js.r9mkgzm2t9.js
webpacker_1 |
92% chunk assetHash: 0fba3c9f83d08f099017
webpacker_1 | Version: webpack 3.5.6
webpacker_1 | Time: 3059ms
webpacker_1 | Asset Size Chunks Chunk Names
webpacker_1 | hello_elm-a49ad0a3ed48411416eb.js 1.87 MB 0 [emitted] [big] hello_elm
webpacker_1 | Main-f0a26307d1db1882a32b.js 1.87 MB 1 [emitted] [big] Main
webpacker_1 | application-963cd78993444428f61c.js 896 kB 2 [emitted] [big] application
webpacker_1 | manifest.json 182 bytes [emitted]
webpacker_1 | [34] (webpack)-dev-server/client?http://localhost:3035 5.83 kB {0} {1} {2} [built]
webpacker_1 | [35] ./node_modules/url/url.js 23.3 kB {0} {1} {2} [built]
webpacker_1 | [41] ./node_modules/strip-ansi/index.js 161 bytes {0} {1} {2} [built]
webpacker_1 | [43] ./node_modules/loglevel/lib/loglevel.js 7.74 kB {0} {1} {2} [built]
webpacker_1 | [44] (webpack)-dev-server/client/socket.js 856 bytes {0} {1} {2} [built]
webpacker_1 | [45] ./node_modules/sockjs-client/lib/entry.js 244 bytes {0} {1} {2} [built]
webpacker_1 | [77] (webpack)-dev-server/client/overlay.js 3.6 kB {0} {1} {2} [built]
webpacker_1 | [82] (webpack)/hot nonrecursive ^\.\/log$ 170 bytes {0} {1} {2} [built]
webpacker_1 | [84] (webpack)/hot/emitter.js 77 bytes {0} {1} {2} [built]
webpacker_1 | [86] ./app/javascript/packs/Main.elm 335 kB {0} {1} [built]
webpacker_1 | [87] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/application.js 40 bytes {2} [built]
webpacker_1 | [88] ./app/javascript/packs/application.js 515 bytes {2} [built]
webpacker_1 | [89] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/hello_elm.js 40 bytes {0} [built]
webpacker_1 | [90] ./app/javascript/packs/hello_elm.js 396 bytes {0} [built]
webpacker_1 | [91] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/Main.elm 40 bytes {1} [built]
webpacker_1 | + 77 hidden modules
webpacker_1 | webpack: Compiled successfully.
webpacker_1 | Project is running at http://localhost:3035/
webpacker_1 | webpack output is served from /packs/
webpacker_1 | Content not from webpack is served from /app/public/packs
webpacker_1 | 404s will fallback to /index.html
webpacker_1 | Running /app/node_modules/.bin/elm-make /app/app/javascript/packs/Main.elm --yes --warn --debug --output /tmp/117813-1-1pnkvvy.kvz0s2x1or.js
webpacker_1 | 14% buiSuccess! Compiled 1 module. 17 active ...s-client/lib/transport/xdr-polling.js
webpacker_1 | Successfully generated /tmp/117813-1-1pnkvvy.kvz0s2x1or.js
webpacker_1 |
webpack 92% chunk assetHash: 0fba3c9f83d08f099017
webpacker_1 | Version: webpack 3.5.6
webpacker_1 | Time: 3705ms
webpacker_1 | Asset Size Chunks Chunk Names
webpacker_1 | hello_elm-a49ad0a3ed48411416eb.js 1.87 MB 0 [emitted] [big] hello_elm
webpacker_1 | Main-f0a26307d1db1882a32b.js 1.87 MB 1 [emitted] [big] Main
webpacker_1 | application-963cd78993444428f61c.js 896 kB 2 [emitted] [big] application
webpacker_1 | manifest.json 182 bytes [emitted]
webpacker_1 | [34] (webpack)-dev-server/client?http://localhost:3035 5.83 kB {0} {1} {2} [built]
webpacker_1 | [35] ./node_modules/url/url.js 23.3 kB {0} {1} {2} [built]
webpacker_1 | [41] ./node_modules/strip-ansi/index.js 161 bytes {0} {1} {2} [built]
webpacker_1 | [43] ./node_modules/loglevel/lib/loglevel.js 7.74 kB {0} {1} {2} [built]
webpacker_1 | [44] (webpack)-dev-server/client/socket.js 856 bytes {0} {1} {2} [built]
webpacker_1 | [45] ./node_modules/sockjs-client/lib/entry.js 244 bytes {0} {1} {2} [built]
webpacker_1 | [77] (webpack)-dev-server/client/overlay.js 3.6 kB {0} {1} {2} [built]
webpacker_1 | [82] (webpack)/hot nonrecursive ^\.\/log$ 170 bytes {0} {1} {2} [built]
webpacker_1 | [84] (webpack)/hot/emitter.js 77 bytes {0} {1} {2} [built]
webpacker_1 | [86] ./app/javascript/packs/Main.elm 335 kB {0} {1} [built]
webpacker_1 | [87] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/application.js 40 bytes {2} [built]
webpacker_1 | [88] ./app/javascript/packs/application.js 515 bytes {2} [built]
webpacker_1 | [89] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/hello_elm.js 40 bytes {0} [built]
webpacker_1 | [90] ./app/javascript/packs/hello_elm.js 396 bytes {0} [built]
webpacker_1 | [91] multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/Main.elm 40 bytes {1} [built]
webpacker_1 | + 77 hidden modules
webpacker_1 | webpack: Compiled successfully.
app_1 | DEPRECATION WARNING: ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead. (called from require at /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:82)
app_1 | W, [2017-09-13T15:44:45.382875 #1] WARN -- : [SKYLIGHT] [1.3.1] Running Skylight in development mode. No data will be reported until you deploy your app.
app_1 | (To disable this message for all local apps, run `skylight disable_dev_warning`.)
app_1 | /app/app/models/test_attempts/context_test_attempt.rb:86: warning: circular argument reference - ability_estimate
app_1 | => Booting Puma
app_1 | => Rails 5.1.4 application starting in development
app_1 | => Run `rails server -h` for more startup options
app_1 | Puma starting in single mode...
app_1 | * Version 3.10.0 (ruby 2.4.1-p111), codename: Russell's Teapot
app_1 | * Min threads: 5, max threads: 5
app_1 | * Environment: development
app_1 | * Listening on tcp://0.0.0.0:3000
app_1 | Use Ctrl-C to stop
app_1 | Started GET "/" for 172.18.0.1 at 2017-09-13 15:44:56 +0000
app_1 | Cannot render console from 172.18.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
app_1 | (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
app_1 | Processing by PagesController#index as HTML
app_1 | (0.3ms) BEGIN
app_1 | (0.3ms) ROLLBACK
app_1 | Rendering layouts/application.html.haml
app_1 | Rendering pages/index.html.haml within layouts/application
app_1 | Rendered pages/index.html.haml within layouts/application (78.9ms)
app_1 | Rendered shared/_head.html.haml (37895.2ms)
app_1 | Rendered shared/_flash.html.haml (1.0ms)
app_1 | Rendered shared/_header.html.haml (39.9ms)
app_1 | Rendered shared/_footer.html.haml (16.0ms)
app_1 | Rendered shared/_analytics.html.haml (0.9ms)
app_1 | Rendered layouts/application.html.haml (38089.9ms)
app_1 | Completed 200 OK in 38677ms (Views: 38152.2ms | ActiveRecord: 7.0ms)
app_1 |
app_1 |
app_1 | 2017-09-13 15:45:35 +0000: Rack app error handling request { GET / }
app_1 | #<Errno::EADDRNOTAVAIL: Cannot assign requested address - connect(2) for [::1]:3035>
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `__connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:56:in `connect_internal'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:137:in `connect'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:627:in `block in tcp'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `each'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `foreach'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:617:in `tcp'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server.rb:9:in `running?'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server_proxy.rb:7:in `rewrite_response'
app_1 | /usr/local/bundle/gems/rack-proxy-0.6.2/lib/rack/proxy.rb:57:in `call'
app_1 | /usr/local/bundle/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
app_1 | 2017-09-13 15:45:35 +0000: Rack app error handling request { GET /favicon.ico }
app_1 | #<Errno::EADDRNOTAVAIL: Cannot assign requested address - connect(2) for [::1]:3035>
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `__connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:56:in `connect_internal'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:137:in `connect'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:627:in `block in tcp'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `each'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `foreach'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:617:in `tcp'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server.rb:9:in `running?'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server_proxy.rb:7:in `rewrite_response'
app_1 | /usr/local/bundle/gems/rack-proxy-0.6.2/lib/rack/proxy.rb:57:in `call'
app_1 | /usr/local/bundle/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
app_1 | Started GET "/" for 172.18.0.1 at 2017-09-13 15:45:51 +0000
app_1 | Cannot render console from 172.18.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
app_1 | Processing by PagesController#index as HTML
app_1 | (0.2ms) BEGIN
app_1 | (0.2ms) ROLLBACK
app_1 | Rendering layouts/application.html.haml
app_1 | Rendering pages/index.html.haml within layouts/application
app_1 | Rendered shared/_locked_flash.html.haml (1.2ms)
app_1 | Rendered pages/index.html.haml within layouts/application (15.5ms)
app_1 | Rendered shared/_head.html.haml (164.7ms)
app_1 | Rendered shared/_flash.html.haml (1.2ms)
app_1 | Rendered shared/_header.html.haml (20.2ms)
app_1 | Rendered shared/_footer.html.haml (8.1ms)
app_1 | Rendered shared/_analytics.html.haml (1.0ms)
app_1 | Rendered layouts/application.html.haml (253.2ms)
app_1 | Completed 200 OK in 294ms (Views: 269.1ms | ActiveRecord: 5.4ms)
app_1 |
app_1 |
app_1 | 2017-09-13 15:45:51 +0000: Rack app error handling request { GET / }
app_1 | #<Errno::EADDRNOTAVAIL: Cannot assign requested address - connect(2) for [::1]:3035>
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `__connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:56:in `connect_internal'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:137:in `connect'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:627:in `block in tcp'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `each'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `foreach'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:617:in `tcp'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server.rb:9:in `running?'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server_proxy.rb:7:in `rewrite_response'
app_1 | /usr/local/bundle/gems/rack-proxy-0.6.2/lib/rack/proxy.rb:57:in `call'
app_1 | /usr/local/bundle/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
app_1 | 2017-09-13 15:45:51 +0000: Rack app error handling request { GET /favicon.ico }
app_1 | #<Errno::EADDRNOTAVAIL: Cannot assign requested address - connect(2) for [::1]:3035>
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `__connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:1198:in `connect_nonblock'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:56:in `connect_internal'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:137:in `connect'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:627:in `block in tcp'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `each'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:227:in `foreach'
app_1 | /usr/local/lib/ruby/2.4.0/socket.rb:617:in `tcp'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server.rb:9:in `running?'
app_1 | /usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server_proxy.rb:7:in `rewrite_response'
app_1 | /usr/local/bundle/gems/rack-proxy-0.6.2/lib/rack/proxy.rb:57:in `call'
app_1 | /usr/local/bundle/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
app_1 | /usr/local/bundle/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
Puma caught this error: Cannot assign requested address - connect(2) for [::1]:3035 (Errno::EADDRNOTAVAIL)
/usr/local/lib/ruby/2.4.0/socket.rb:1198:in `__connect_nonblock'
/usr/local/lib/ruby/2.4.0/socket.rb:1198:in `connect_nonblock'
/usr/local/lib/ruby/2.4.0/socket.rb:56:in `connect_internal'
/usr/local/lib/ruby/2.4.0/socket.rb:137:in `connect'
/usr/local/lib/ruby/2.4.0/socket.rb:627:in `block in tcp'
/usr/local/lib/ruby/2.4.0/socket.rb:227:in `each'
/usr/local/lib/ruby/2.4.0/socket.rb:227:in `foreach'
/usr/local/lib/ruby/2.4.0/socket.rb:617:in `tcp'
/usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server.rb:9:in `running?'
/usr/local/bundle/gems/webpacker-3.0.1/lib/webpacker/dev_server_proxy.rb:7:in `rewrite_response'
/usr/local/bundle/gems/rack-proxy-0.6.2/lib/rack/proxy.rb:57:in `call'
/usr/local/bundle/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
/usr/local/bundle/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
/usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
/usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
/usr/local/bundle/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
/usr/local/bundle/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
最佳答案
您需要设置 --listen-host
传递给 webpack-dev-server
的值.
您可以通过编辑文件 config/webpacker.yml
来实现此目的。并更改 development:dev_server:host:
值来自 localhost
至 0.0.0.0
,应该可以解决问题。
关于ruby-on-rails - Rails、Webpacker 和 Docker:无法分配请求的地址 - connect(2) for [::1]:3035,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46188242/
以下是一个非常简单的ruby服务器。 require 'socket' local_socket = Socket.new(:INET, :STREAM) local_addr = Socket.
我正在使用 OS X(使用 bash),并且是 unix 的新手。我想知道是否可以修改一些文件以便运行 ruby 程序,我不需要“ruby file.rb”,而是可以运行“ruby.rb”。 有理
我在用 Ruby 替换字符串时遇到一些问题。 我的原文:人之所为不如兽之所为。 我想替换为:==What== human does is not like ==what== animal does.
我想在一个循环中从 Ruby 脚本做这样的事情: 写一个文件a.rb(每次迭代都会改变) 执行系统(ruby 'a.rb') a.rb 将带有结果的字符串写入文件“results” a.rb 完成并且
我的问题是尝试创建一个本地服务器,以便我可以理解由我的新团队开发的应用程序。我的问题是我使用的是 Ruby 2.3.3,而 Gemfile 需要 2.3.1。我无法编辑 Gemfile,因为我被告知很
我有一个使用 GLI 框架用 Ruby 编写的命令行实用程序。我想在我的主目录中配置我的命令行实用程序,使用 Ruby 本身作为 DSL 来处理它(类似于 Gemfile 或 Rakefile)。 我
我的 Rails 应用 Controller 中有这段代码: def delete object = model.datamapper_class.first(:sourced_id =>
我正在寻找的解析器应该: 对 Ruby 解析友好, 规则设计优雅, 产生用户友好的解析错误, 用户文档的数量应该比计算器示例多, UPD:允许在编写语法时省略可选的空格。 快速解析不是一个重要的特性。
我刚开始使用 Ruby,听说有一种“Ruby 方式”编码。除了 Ruby on Rails 之外,还有哪些项目适合学习并被认可且设计良好? 最佳答案 Prawn被明确地创建为不仅是一个该死的好 PDF
我知道之前有人问过类似的问题,但是我该如何构建一个无需在前面输入“ruby”就可以在终端中运行的 Ruby 文件呢? 这里的最终目标是创建一个命令行工具包类型的东西。现在,为了执行我希望用户能够执行的
例如哈希a是{:name=>'mike',:age=>27,:gender=>'male'}哈希 b 是 {:name=>'mike'} 我想知道是否有更好的方法来判断 b 哈希是否在 a 哈希内,而
我是一名决定学习 Ruby 和 Ruby on Rails 的 ASP.NET MVC 开发人员。我已经有所了解并在 RoR 上创建了一个网站。在 ASP.NET MVC 上开发,我一直使用三层架构:
最近我看到 Gary Bernhardt 展示了他用来在 vim 中执行 Ruby 代码的 vim 快捷方式。捷径是 :map ,t :w\|:!ruby %. 似乎这个方法总是执行系统 Rub
在为 this question about Blue Ruby 选择的答案中,查克说: All of the current Ruby implementations are compiled to
我有一个 Ruby 数组 > list = Request.find_all_by_artist("Metallica").map(&:song) => ["Nothing else Matters"
我在四舍五入时遇到问题。我有一个 float ,我想将其四舍五入到小数点后的百分之一。但是,我只能使用 .round ,它基本上将它变成一个 int,意思是 2.34.round # => 2. 有没
我使用 ruby on rails 编写了一个小型 Web 应用程序,它的主要目的是上传、存储和显示来自 xml(文件最多几 MB)文件的结果。运行大约 2 个月后,我注意到 mongrel 进程
我们如何用 Ruby 转换像这样的字符串: 𝑙𝑎𝑡𝑜𝑟𝑟𝑒 收件人: Latorre 最佳答案 s = "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" => "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" s.u
通过 ruby monk 时,他们偶尔会从左侧字段中抛出一段语法不熟悉的代码: def compute(xyz) return nil unless xyz xyz.map {|a,
不确定我做错了什么,但我似乎弄错了。 问题是,给你一串空格分隔的数字,你必须返回最大和最小的数字。 注意:所有数字都是有效的 Int32,不需要验证它们。输入字符串中始终至少有一个数字。输出字符串必须
我是一名优秀的程序员,十分优秀!