Tag: ruby在轨道

docker容器的ERR_CONNECTION_REFUSED

我是新来的Docker,并试图做一个演示Rails应用程序。 我做了一个dockerfile,看起来像这样: FROM ruby:2.2 # Install apt based dependencies required to run Rails as # well as RubyGems. As the Ruby image itself is based on a # Debian image, we use apt-get to install those. RUN apt-get update && apt-get install -y \ build-essential \ nodejs # Configure the main working directory. This is […]

ENV 。编码返回#<Encoding:ASCII-8BIT>在生产时被分配一个Unicodestring

我在我的Rails应用程序中使用ENV [“VARIABLE”]设置为一个Unicodestring。 在生产(这是一个docker容器),这个ENV [“VARIABLE”]用Encoding:ASCII-8BIT (虽然ENV [“PWD”],例如编码为Encoding:UTF-8 )。 在development ,每个variables都使用Encoding:UTF-8进行Encoding:UTF-8 。 ASCII-8BIT的编码阻止我在视图中显示variables。 原因是什么? 我该如何解决?

如何debugging与撬码在docker的应用程序?

我有一个rails应用程序在开发环境中的Docker容器中运行。 当我尝试在代码中的某处放置binding.pry进行debugging并附加到容器时,我可以在输出中看到pry提示符,但它不会暂停,并且不能像docker那样与其交互容器。 那么如何debugging一个容器化的应用程序呢?

如何把sidekiq放入一个rails应用程序中的Docker?

我正在使用rails,sidekiq和docker。 我的docker-compose.yml文件 sidekiq: build: . command: bundle exec sidekiq -C config/sidekiq.yml links: – db – redis config / sidekiq.yml文件 :pidfile: ./tmp/pids/sidekiq.pid :logfile: ./log/sidekiq.log :queues: – default 运行docker docker-compose up ,sidekiq服务无法正确启动。 sidekiq_1 | No such file or directory @ rb_sysopen – /testapp/tmp/pids/sidekiq.pid sidekiq_1 | /usr/local/bundle/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:365:in `initialize' sidekiq_1 | /usr/local/bundle/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:365:in `open' sidekiq_1 | /usr/local/bundle/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:365:in `write_pid' sidekiq_1 | […]

如何在Travis CI上获得Docker主机IP?

我有一个关于Travis的Rails回购。 它有一个docker-compose.yml文件: postgres: image: postgres ports: – "5433:5432" environment: – POSTGRES_USER=calories – POSTGRES_PASSWORD=secretpassword (我不得不使用5433作为主机端口,因为5432给了我一个错误: Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use ) 和一个travis.yml: sudo: required services: – docker language: ruby cache: bundler before_install: # Install docker-compose – curl -L https://github.com/docker/compose/releases/download/1.4.0/docker-compose-`uname -s`-`uname -m` > docker-compose – chmod +x docker-compose – sudo […]

在docker下应该设置actioncable的URL是什么?

在Docker下使用带有Actioncable的Rails时,应该将动作电缆URL设置为什么? 通常情况下是这样的 config.action_cable.url = "ws://localhost:3000/cable" 但是这不起作用。 我尝试了一些排列,但我得到的是 Started GET "/cable" for 172.18.0.6 at 2016-11-22 17:49:37 +0000 Started GET "/cable/"[non-WebSocket] for 172.18.0.6 at 2016-11-22 17:49:37 +0000 Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: close, HTTP_UPGRADE: ) Finished "/cable/"[non-WebSocket] for 172.18.0.6 at 2016-11-22 17:49:37 +0000 我的docker-compose.yml文件在这里 。 我已经试过使用一个单独的有线电视图像(注释掉)没有任何运气。 我不是那么遥远,应用程序图像和有线电视图像似乎是冲突的,一个或两个美洲狮实例不断重新启动。 解决这将是一个奖金。

Docker for Mac – mkmf.rb找不到ruby的头文件

我更新了我的Mac上的XCode,从那时起,当使用docker-sync-stack start Docker docker-sync-stack start我得到这个错误信息: mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h 我试着安装ruby: brew install rbenv ruby-build但这不会改变任何东西。 有谁知道如何解决它? 谢谢!