• CentOS上安装配置Ruby on Rails


    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 you@example.com
    $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.


  • 相关阅读:
    2020毕业设计选用4412开发板,实战教程,小成果不放过
    学习嵌入式有决心4412再送免费教程
    iTOP4412开发板can测试工具使用文档
    iTOP4412Ubuntu系统源码ubuntu没有声音的解决办法
    修身养性,为人处事100条
    用X++实现有规律分割的长字符串,分别提取(如逗号隔开)
    自定义Dialog中对数组的取值
    Common实现任何Form定位查询转到当前Form种过滤符合条件的数据区域
    用X++得到当前用户是否有某Security Key的权限级别,完整Job演示
    获取table中的系统字段信息
  • 原文地址:https://www.cnblogs.com/blfbuaa/p/7400348.html
Copyright © 2020-2023  润新知