Tag: ruby在轨道 5

使Rails应用程序文件夹只读吗?

我有一个Rails应用程序,并希望分享它和Resque工作者docker集装箱之间的文件夹。 所以我想创build一个共享卷,并将其作为只读装入容器中。 据我所知,唯一可写文件夹应该logging/和tmp / 我应该调整哪些configuration来触发写入这些文件夹?

AWS ECS – Rails Container无法通过mysqld.sock连接链接的容器mysql

我已经在AWS ECS上安装了应用程序,包含存储库,任务和集群pipe理。 我的Dockerfile是 FROM ruby:2.4.1 ENV LANG C.UTF-8 RUN apt-get update && \ apt-get install -y nodejs \ vim \ mysql-client –no-install-recommends && rm -rf /var/lib/apt/lists/* WORKDIR /tmp ADD ./Gemfile Gemfile ADD ./Gemfile.lock Gemfile.lock RUN bundle install ENV APP_ROOT /workspace RUN mkdir -p $APP_ROOT WORKDIR $APP_ROOT COPY . $APP_ROOT EXPOSE 3000 CMD ["rails", "server", "-b", […]

服务器是否在主机“localhost”(:: 1)上运行,并接受端口5432上的TCP / IP连接?

在安装Ruby on Rail时,我在本地系统上运行Docker实例时出现问题。 请参阅我的dockerconfiguration文件: – Dockerfile FROM ruby:2.3.1 RUN useradd -ms /bin/bash web RUN apt-get update -qq && apt-get install -y build-essential RUN apt-get -y install nginx RUN apt-get -y install sudo # for postgres RUN apt-get install -y libpq-dev # for nokogiri RUN apt-get install -y libxml2-dev libxslt1-dev # for a JS runtime RUN […]

在docker for rails应用程序rest-client中启用CORS

我有两个应用程序运行在不同的泊坞窗图像。 首先暴露在端口3000:3000和第二4000:4000。 第一个应用程序有一些资源,我想通过第二个应用程序使用rest-client获取。 docker集装箱可能是个问题。 这里有错误: Errno :: ECONNREFUSED在FilmsController#index中 无法打开TCP连接到本地主机:3000(连接被拒绝 – 连接(2)为“本地主机”端口3000) //第一个应用程序: 公开http:// localhost:3000 / movies上的资源 对其他networking开放 允许交叉来源请求 第一个应用程序的application.rb文件 module Movies class Application < Rails::Application config.web_console.whiny_requests = false config.middleware.insert_before 0, Rack::Cors do allow do origins '*' resource '*', :headers => :any, :methods => [:get, :post, :options] end end end end //第二个应用程序: 在端口上运行:4000 有一个模型电影 一个控制器 电影模型: […]

在Docker中使用Spring保存文件后“const_get':未初始化的常量(NameError)'

我在Spring和Guard中使用Docker中的rails。 请参阅Guardfile: guard 'rspec', cmd: "#{env_vars} spring rspec -color -f doc", :all_on_start => false, :all_after_pass => false do watch(%r{^spec/.+_spec\.rb$}) 奇怪的问题:当上面的命令中有spring标签时,我在运行规范时遇到了一个错误,但只是在以某种方式保存了容器中的一个文件之后。 这是错误的: /usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/inflector/methods.rb:268:in `const_get': uninitialized constant User (NameError) from /usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/inflector/methods.rb:268:in `block in constantize' from /usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/inflector/methods.rb:266:in `each' from /usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/inflector/methods.rb:266:in `inject' from /usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/inflector/methods.rb:266:in `constantize' from /usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:583:in `get' from /usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:614:in `constantize' from /usr/local/bundle/gems/devise-4.2.0/lib/devise.rb:301:in `get' from /usr/local/bundle/gems/devise-4.2.0/lib/devise/mapping.rb:81:in `to' from /usr/local/bundle/gems/devise-4.2.0/lib/devise/mapping.rb:76:in […]