Tag: ruby在轨道

在Docker容器中运行Rails应用程序

我想在一台debian机器上的Docker容器中运行Rails 4.2.1应用程序。 当我运行bundle exec rails时,出现这个错误: Could not find json-1.7.7 in any of the sources Run `bundle install` to install missing gems. 当我运行软件包安装时,我得到这个错误: Gem :: Ext :: BuildError:错误:无法构buildgem原生扩展。 /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150604-137-10l84fa. rb extconf.rb creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling generator.c In file included from generator.c:1:0: ../fbuffer/fbuffer.h: In function 'fbuffer_to_s': ../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires […]

如何使用kubernetes将rails应用程序部署到Google容器引擎?

我已经尝试了很多方法来构build我的rails应用程序到一个泊坞窗的图像。 并将其部署到谷歌容器引擎。 但直到现在,没有人成功。 我的Dockerfile(在根轨道下) FROM ruby:2.2.2 RUN apt-get update -qq && apt-get install -y build-essential RUN apt-get install -y nodejs ENV APP_HOME /myapp RUN mkdir $APP_HOME WORKDIR $APP_HOME ADD Gemfile $APP_HOME/Gemfile ADD Gemfile.lock $APP_HOME/Gemfile.lock ADD vendor/gems/my_gem $APP_HOME/vendor/gems/my_gem ADD init.sh $APP_HOME/ RUN export LANG=C.UTF-8 && bundle install ADD . $APP_HOME CMD ["sh", "init.sh"] 我的init.sh #!/bin/bash bundle […]

Docker Rails Server拒绝连接

我有铁路Api服务器,我与我的Dockerfile安装,我试图从主机访问它,但我得到连接拒绝后,启动rails服务器和curl的Docker容器。 curl curl 192.168.99.100:32776 docker集装箱:港口 iptables -L在'docker-machine ssh default' Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination DOCKER all — anywhere anywhere ACCEPT all — anywhere anywhere ctstate RELATED,ESTABLISHED ACCEPT all — anywhere anywhere ACCEPT all — anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot […]

Ruby on Rails使用命令行“计算图像的md5

我正在试图在ruby脚本和ruby on rails服务器上生成图像的md5哈希。 在脚本(这是在Mac上本地运行)我正在做: `md5 -q path-to-file` 这工作得很好,生成一些像Added new md5: efe99a09e6e1b192314891b960018bd4当我在服务器上运行相同的命令(在Linux机器上生产运行),它成为一个空string def add_md5_if_empty(test_image) if md5.nil? self.md5 = `md5 -q #{test_image.image.path}` logger.info "Added new md5: #{self.md5} for image at path: #{test_image.image.path}" test_image.save end end I, [2016-02-24T03:48:36.879648 #42] INFO — : Added new md5: for image at path: /app/public/system/test_images/images/000/209/309/original/filename.png 我的猜测是,轨道服务器(Linux机器上)ruby没有md5命令。 另外我的项目是使用Docker,所以也许有一些依赖,我失踪了。 任何帮助将不胜感激。

泊坞窗 – 组合应用程序和数据库之间的链接

我有一个问题regradingdocker组成的链接。 我试图链接一个ruby机架应用程序和MySQL,并解决数据库主机名称。 泊坞窗,compose.yml: version: '2' services: db: image: library/mysql:5.6.22 environment: MYSQL_ROOT_PASSWORD: xxx MYSQL_DATABASE: xxx MYSQL_USER: xxx MYSQL_PASSWORD: xxx ports: – "3306:3306" restart: always snow: build: . links: – db depends_on: – db ports: – "9292:9292" restart: always 雪的Dockerfile: # Docker file for CentOS with RVM FROM centos:centos7 MAINTAINER "XXXXX" RUN useradd -ms /bin/bash t_user RUN […]

如何安装je​​kyll到Docker镜像?

我想生成一个具有命令jekyll可用的docker图像。 我生成了以下内容的Dockerfile : # https://hub.docker.com/_/ruby/ FROM ruby:slim RUN gem install jekyll 不幸的是抛出一个错误: ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. current directory: /usr/local/bundle/gems/ffi-1.9.10/ext/ffi_c /usr/local/bin/ruby -r ./siteconf20160615-7-12pthrg.rb extconf.rb checking for ffi.h… *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log […]

在存储库docker.io/library/ <package>中找不到最新标记

当build立一个docker文件。 FROM ruby:latest MAINTAINER … 我收到一些信息: Pulling repository docker.io/library/ruby bfe1e909440a: Download complete 33a372e3ad95: Download complete 1230b07f5c40: Download complete 0ebd84a329dd: Download complete … Pulling repository docker.io/library/ruby Tag latest not found in repository docker.io/library/ruby 我试着在控制台“docker pull ruby​​”中运行,它通过相同的错误。 这是docker服务器的问题吗?

在docker中不能以守护进程运行puma

我有一个rails5应用程序,并使用美洲狮,因为它的networking服务。 可以在正常的环境中部署它,但是在以守护进程模式将其部署到docker时失败。 我会列出我可以做什么,我不能做如下: 能够: 没有docker的rails s 没有docker的puma puma –daemon没有docker的puma –daemon进程 puma -C config/puma.rb没有docker#其中集守护程序:真 docker工人的puma 不能: docker中的`puma –daemon' puma -C config/puma.rb ,其中set守护程序:true 结论是,我不能在守护进程模式下运行美洲狮,当我使用docker-compose up命令时,它返回: 彪马开始在单一模式… 版本3.8.2(ruby 2.4.0-p0),代号:Sassy Salamander 最小线程:5,最大线程:5 环境:生产 Daemonizing … 网站1以代码0退出 没有任何其他信息。 那么,这真的发生了什么?

docker-compse生成错误 – 不受支持的版本

我正在尝试使用postgres dockerise我的rails应用程序。 我遵循了几个在线tutoarials,但我有很多麻烦。 我也支持不起作用的公司代理 我可以dockerdocker生成–build_args并通过http代理。 我不想运行docker构build和我得到以下错误: ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version ("2.0", "2.1", "3.0", "3.1", "3.2") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions […]

如何使用dockerfile安装ruby和bundler?

这里是新的ruby和打包机。 我正在使用这个docker文件将它们安装在docker镜像中: FROM alpine:3.5 # Install Ruby, Ruby Bundler and other ruby dependencies RUN apk add –update \ ruby ruby-bigdecimal ruby-bundler \ ca-certificates libressl \ libressl-dev build-base ruby-dev \ ruby-rdoc ruby-io-console ruby-irb; \ \ && bundle config build.nokogiri –use-system-libraries; \ && bundle config git.allow_insecure true; \ \ && gem install json foreman –no-rdoc –no-ri; \ […]