centos6下ruby环境部署--详细--self

[i][b]本文为firedragonpzy原创,转载务必在明显处注明:
转载自【Softeware MyZone】原文链接: http://www.firedragonpzy.com.cn/index.php/archives/440[/b][/i]

-----------------------------------------------------------------------centos6.2下ruby环境部署----------------------------------------------------------------------
一:安装环境依赖包(gcc -v:检查是否存在gcc环境,若没有执行以下安装;若有,最好执行)
yum -y install gcc

yum install flex autoconf zlib curl zlib-devel curl-devel bzip2 bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel gcc+ gcc-c++ libxml2 libxml2-devel libxslt libxslt-devel

二:安装rvm sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

三:安装ruby rvm install 1.9.2(安装ruby) rvm use ruby-1.9.2 --default(将ruby设置为默认环境)

四:安装rails gem install rails -v 3.0.0

五:安装mysql yum install mysql*

--------------------------------------------------------------------------至此,环境部署完毕--------------------------------------------------------------------------


----------------------------------------------------------------------------服务器配置安装-------------------------------------------------------------------------------
一: 安装应用服务器 gem install passenger
二: 安装web服务器(nginx) passenger-install-nginx-module(期间一路回车即可,【pcre最好安装,不装也可】)
三: 配置nginx.conf
server {
listen 80;
server_name localhost;
root /xxx/public; # <--- be sure to point to 'public'!定位项目的public目录
passenger_enabled on;
rails_env development;
charset utf-8;

#access_log logs/host.access.log main;



#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
四: 服务启动:命令执行nginx目录中sbin下的nginx 例如:我的安装目录是/opt/nginx 则执行/opt/nginx/sbin/nginx即可


-----------------------------------------------------------------------------注意事项-------------------------------------------------------------------------------
一: LoadError (no such file to load — openssl)
解决方法:rvm remove ruby【-版本】 或者yum remove ruby --卸载ruby,重装即可
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值