如何在CentOS上搭建ruby on rails 指南环境

温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
总有一天,会有一个人,看你写过的所有状态,读完写的所有微博,看你从小到大的所有照片,甚至去别的地方寻找关于你的信息,试着听你听的歌,走你走过的地方,看你喜欢看的书,品尝你总是大呼好吃的东西……只是想弥补上,你的青春——他(她)迟到的时光。
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
yum install zlib-devel wget openssl-devel
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz&
tar zxf ruby-1.8.7-p72.tar.gz cd ruby-1.8.7-p72
./configure
make install
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz&
tar -zxvf rubygems-1.3.5.tgz&
ruby setup.rb&
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
yum install zlib-devel&
find / -name zilb
cd ruby-1.8.7-p72/ext/zlib/
ruby extconf.rb
make clean
make install
-------------------------------------------------------------------------------------------------------------------
gem update --system
gem install rails
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
.安装 mongrel& gem install mongrel&
7.安装 openssl& yum install openssl* find / -name openssh cd &ruby-1.8.7-p72/ext/openssl&
ruby extconf.rb&
make clean
make make install 8. 安装 mysql& yum install mysql-devel yum install mysql-server
阅读(238)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'Centos5.5搭建ruby on rails环境',
blogAbstract:'yum groupinstall \"Development Tools\"
yum install zlib-devel wget openssl-devel
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz&
blogTag:'ruby,install,make,openssl,yum',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:3,
publishTime:8,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'总有一天,会有一个人,看你写过的所有状态,读完写的所有微博,看你从小到大的所有照片,甚至去别的地方寻找关于你的信息,试着听你听的歌,走你走过的地方,看你喜欢看的书,品尝你总是大呼好吃的东西……只是想弥补上,你的青春——他(她)迟到的时光。',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}微信公众号:centoscn
CentOS下配置Ruby on Rails并部署Redmine
确保已安装了依赖的包:
[plain]&view plaincopy
下载git包并编译安装:
[plain]&view plaincopy
查看git版本:
[plain]&view plaincopy
[plain]&view plaincopy
[plain]&view plaincopy
[plain]&view plaincopy
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
Example for a MySQL database using ruby 1.9 (adapter must be set to&mysql2):
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: my_password
gem install bundler
bundle install --without development test
If ImageMagick is not installed on your system, you should skip the installation of the rmagick gem using:
bundle install --without development test rmagick
with Redmine 2.x:
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
The user account running the application must have write permission on the following subdirectories:
files&(storage of attachments)
log&(application log file&production.log)
tmp&and&tmp/pdf&(create these ones if not present, used to generate PDF documents among other things)
public/plugin_assets&(assets of plugins)
E.g., assuming you run the application with a redmine user account:
mkdir -p tmp tmp/pdf public/plugin_assets
sudo chown -R redmine:redmine files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
with Redmine 2.x:
ruby script/rails server webrick -e production
Use default administrator account to log in:
login: admin
password: admin
You can go to&Administration&menu and choose&Settings&to modify most of the application settings.
------分隔线----------------------------
导读 Hadoop分布式文件系统(HDFS)被设计成适合运行在通用硬件(commodity hardware)上...
导读 Chef是一个IT基础设施自动化软件,它可以管理你组织中所有的服务器和网络设备。...
自从甲骨文收购 MySQL 后,由于甲骨文对 MySQL 的开发和维护更多倾向于闭门的立场,很...如何快速正确的安装 Ruby, Rails 运行环境 · Ruby China
如何快速正确的安装 Ruby, Rails 运行环境
对于新入门的开发者,如何安装 Ruby, Ruby Gems 和 Rails 的运行环境可能会是个问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境。
次安装方法同样适用于产品环境!
首先确定操作系统环境,不建议在 Windows 上面搞,所以你需要用:
任意 Linux 发行版本(,, Redhat, ArchLinux ...)
强烈新手使用 Ubuntu 省掉不必要的麻烦!
以下代码区域,带有 $ 打头的表示需要在控制台(终端)下面执行(不包括 $ 符号)
步骤0 - 安装系统需要的包# For Mac
# 先安装 [Xcode](/xcode/) 开发工具,它将帮你安装好 Unix 环境需要的开发包
# 然后安装 [Homebrew](http://brew.sh)
$ ruby -e "$(curl -fsSL /Homebrew/install/master/install)"
OS X 安装 Rails 必要的一些三方库
$ brew install libxml2 libxslt libiconv
步骤1 - 安装 RVM
RVM 是干什么的这里就不解释了,后面你将会慢慢搞明白。
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6BABB82D39DC0E3
$ curl -sSL https://get.rvm.io | bash -s stable
# 如果上面的连接失败,可以尝试:
$ curl -L /wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable
期间可能会问你 sudo 管理员密码,以及自动通过 Homebrew 安装依赖包,等待一段时间后就可以成功安装好 RVM。
然后,载入 RVM 环境(新开 Termal 就不用这么做了,会自动重新载入的)
$ source ~/.rvm/scripts/rvm
修改 RVM 下载 Ruby 的源,到 Ruby China 的镜像:
echo "ruby_url=https://cache.ruby-china.org/pub/ruby" & ~/.rvm/user/db
检查一下是否安装正确
rvm 1.22.17 (stable) by Wayne E. Seguin &&, Michal Papis && [https://rvm.io/]
步骤2 - 用 RVM 安装 Ruby 环境$ rvm requirements
$ rvm install 2.3.0
同样继续等待漫长的下载,编译过程,完成以后,Ruby, Ruby Gems 就安装好了。
步骤3 - 设置 Ruby 版本
RVM 装好以后,需要执行下面的命令将指定版本的 Ruby 设置为系统默认版本
$ rvm use 2.3.0 --default
同样,也可以用其他版本号,前提是你有用 rvm install 安装过那个版本
这个时候你可以测试是否正确
ruby 2.3.0 ...
$ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
安装 Bundler$ gem install bundler
步骤4 - 安装 Rails 环境
上面 3 个步骤过后,Ruby 环境就安装好了,接下来安装 Rails
$ gem install rails
然后测试安装是否正确
$ rails -v
Rails 4.2.5
然后开始你的 Ruby,Rails 之旅吧。
欢迎来到 Ruby 的世界!
- 快速安装生产环境的 Ubuntu Server 批量脚本

我要回帖

更多关于 ruby on rails 的文章

 

随机推荐