• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

CentOS上安装配置RubyonRails

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
0.install sublime editor(optional)
ref:http://www.tecmint.com/install-sublime-text-editor-in-linux/


1.install git
$sudo yum install git
$git --verison
2.install rbenv
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l
$ rbenv --version
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ rbenv install -l //show avaliable ruby
3.install package
$sudo yum install openssl-devel
4.install ruby
$rbenv install 2.2.2
$rbenv versions
$rbenv global 2.2.2
$ruby -v
5.install rails
$gem install rails
$rails -v
6.install sqlite and mysql
$echo "options single-request-reopen" >> /etc/resolv.conf
$ sudo yum install sqlite
$ sudo yum install sqlite-devel
$sudo yum install epel-release //get from epel repo as nodejs is not published for centos
$sudo yum install nodejs
$node -v
//http://nomnel.net/blog/install-mysql/ //cannot start mysql server
//$sudo yum install mysql-server
//$sudo yum install mysql-devel
//So I did below
//reference link:http://weblabo.oscasierra.net/installing-mysql-rhel6-with-yum/
$yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
$yum info mysql-community-server
$yum -y install mysql-community-server
$mysqld --version
$mysql --version
$sudo chkconfig mysqld on //set mysqld start automaticlly
$service mysqld start
7. clone remote sourcefiles and start
$git clone https://....git //need to replace 
this line with your url.
$cd splunkportal
$vi config/config.yml
$vi config/database.yml
$vi Gemfile //need to change the version of rails as you installed
$vi .ruby-version (change ruby version to 2.2.2,not 2.2.2p95) 
$bundle install
$sudo gem install rake
$rake db:create
$rake db:migrate
$rails server //if it shows "Listening on tcp://localhost:3000" success!
8. setup git
$git config --global user.name "Your Name"
$git config --global user.email [email protected]
$git config --global core.editor "subl -w" //set sublimetext as editor (sublimetext must be 
installed)
$cd splunkportal //make sure directory is app directory
$git remote -v //List your existing remotes in order to get the name of the remote you want to 
change.
$git remote set-url origin https://....git
$git remote -v //can see both fetch and push are changed to the url you set
9.Development
$git checkout -b NewBranch //create a branch namely "NewBranch"
$git branch //confirm branch
... //change source code
$git status //confirm status
$git add .
$git commit -m "My First Commit"
$git log
$git push -u origin NewBranch //push to remote NewBranch
$git checkout master //Switch local branch to branch 'master'
$git merge NewBranch //update local master(merge with NewBranch), remote master have not changed
$git push -u origin master //push local master to remote master, now github master branched updated.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Windows环境搭建Web自动化测试框架Watir(基于Ruby)发布时间:2022-07-14
下一篇:
Ruby中print、p、puts的区别发布时间:2022-07-14
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap