部署 有谁在 CentOS 上布署过 RoR 么?

plasmiq · 2013年02月08日 · 最后由 huacnlee 回复于 2014年05月05日 · 6103 次阅读

参考了这个流程 http://blog.csdn.net/g599351300/article/details/7635411

文章中提到两种安装 libyaml 的方法,在 centos 下都不管用:(1)直接 tar xzvf yaml-0.1.4.tar.gz 时,安装配置一切正常,Rails -v 也显示 rails 配置成功(Rails 3.2.11)但真正使用 rails new 命令建立第一个框架时却提示没有 libyaml: It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.

(2)用 yum install libyaml-dev 指令时会提示没有 libyaml-dev 包

yum install libyaml-devel

@plasmiq 建议楼主不要在 centos 上,centos 上依赖的包大多数都是旧的,会有很多坑的.

#1 楼 @bhuztez Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile

  • base: yum.phx.singlehop.com
  • extras: mirror.tocici.com
  • updates: centos.sonn.com Setting up Install Process No package libyaml-devel available. Nothing to do

看看 yum search 出什么 yum search libyaml

#3 楼 @plasmiq

用 EPEL 就有了啊。除非有规定说不允许用非官方仓库。

https://fedoraproject.org/wiki/EPEL

#5 楼 @jey no match found

#6 楼 @bhuztez 菜鸟弱弱地问:怎么操作?

$ cat /etc/redhat-release
CentOS release 6.3 (Final)

我这个貌似是最新版 CentOS,部署 ror/mysql/rmagic 没问题,ruby 是用 rvm 装的

CentOS release 6.3 我用的这个版本,别用旧版本一般没坑

你怎么安装 ROR 的?用的 rvm,还是 rbenv?我用这两种,都没有问题。

5.x 6.x 用 rvm 很顺利 注意添加 rpmforge 和 epel 源

http://jwch.sdut.edu.cn/book/server/centos_jwch.html 我上次安装时的记录,可以参考下

yum install libyaml-devel

生产环境一直 centos 5.x 无障碍

我装过一次。因为别人说 centos 更安全。结果我折腾了一天多!vps 重装系统 N 次!最后放弃了。

我今天折腾了一天都没有搞定啊,各种问题

CentOS release 6.2 (Final) 添加上@jasl 说的源 没什么问题呀~用的是 rvm 部署

一直用的 centos

所有 Production 环境选择 CentOS 的,你们的理由第一条是不是都是:别人说......

22楼 已删除

貌似没遇到什么问题。

@cave 同学你想干嘛?

#3 楼 @plasmiq Centos6 64 位 首先 yum 加上 EPEL 然后安装 curl yum install curl curl-devel 这个可能不用装 然后安装 rvm curl -L https://get.rvm.io | bash -s stable 注意 现在不要安装 ruby 然后 rvm requirements 照提示安装 然后 rvm pkg install openssl 然后 rvm install 1.9.3 然后装数据库 然后 git 一个 ruby-china git clone https://github.com/ruby-china/ruby-china.git 然后 bundle

我就不信这几步中间能出错...

这一段是我从 gitlab 的 centos 部署文档里复制下来的,gitlab 是用 rails 框架的,我按照这个文档部署 gitlab 没有问题,希望你也能成

原文地址:https://github.com/gitlabhq/gitlab-recipes/blob/master/install/CentOS_6.md#updating-and-adding-basic-software-and-services

Add EPEL repository

logged in as root

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Install the required tools for gitlab and gitolite

Install the required tools for gitlab and gitolite

logged in as root

yum -y groupinstall 'Development Tools'

### 'Additional Development'

yum -y install vim-enhanced httpd readline readline-devel ncurses-devel gdbm-devel glibc-devel \
               tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc \
               sqlite-devel gcc-c++ libyaml libyaml-devel libffi libffi-devel \
               libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel \
               system-config-firewall-tui python-devel redis sudo mysql-server wget \
               mysql-devel crontabs logwatch logrotate sendmail-cf qtwebkit qtwebkit-devel \
               perl-Time-HiRes

IMPORTANT NOTE About Redhat EL 6

During an installation on an official RHEL 6.3 we found that some packages (in our case gdbm-devel, libffi-devel and libicu-devel) were NOT installed. You MUST make sure that all the packages are installed. The simplest way is to run the above command for a second time and you'll see quite easily of everything is either already installed or "No package XXX available". When you run into this issue you can try installing these required packages from the CentOS distribution.

Update CentOS to the latest set of patches

logged in as root

yum -y update

#9 楼 @keating @zj0713001 curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

各位,遇到这个了问题不?

#27 楼 @JeskTop 好像隐约的遇到过 再贴下是什么时候出现的呗 忘记了...

rvm autolibs rvm_pkg
rvm install 2.1.1

直接 rvm autolibs rvm_pkg RVM 将自动处理 libyaml、readline 之类的库安装的问题

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册