close

Repository registration

# yum install -y centos-release-scl

Installation

# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)

# yum install -y rh-ruby27 which
# scl enable rh-ruby27 bash
...Abbreviation

Various confirmations

# which ruby
/opt/rh/rh-ruby27/root/usr/bin/ruby

# ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]

# yum info rh-ruby27
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * centos-sclo-rh: ty1.mirror.newmediaexpress.com
 * centos-sclo-sclo: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Installed Packages
Name        : rh-ruby27
Arch        : x86_64
Version     : 2.7
Release     : 2.el7
Size        : 0.0
Repo        : installed
From repo   : centos-sclo-rh
Summary     : Package that installs rh-ruby27
License     : GPLv2+
Description : This is the main package for rh-ruby27 Software Collection.

 

yum install rh-ruby27-ruby-devel
 

 gem install rails
 

yum install sqlite-devel
 

rails new project_name

 

 git clone https://github.com/xxxxxxxxxxxxxxxxx/xxxxxxx.git


cd xxxxxxxxxxx

 

yum install mysql-devel
yum install ImageMagick-devel

 

bundle install

 


these 2 keys must be the same

config/secrets.yml
 config/initializers/devise.rb
 

 

bin/rails db:migrate RAILS_ENV=development

 

 

must have 3 env variables

[root@localhost bin]# more /root/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/opt/rh/rh-ruby27/root/usr/local/bin:/opt/rh/rh-ruby27/root/usr/bin:
LD_LIBRARY_PATH=/opt/rh/rh-ruby27/root/usr/local/lib64:/opt/rh/rh-ruby27/root/usr/lib64
PKG_CONFIG_PATH=/opt/rh/rh-ruby27/root/usr/local/lib64/pkgconfig:/opt/rh/rh-ruby27/root/usr/lib64/pkgconfig


export PATH
export LD_LIBRARY_PATH
export PKG_CONFIG_PATH
 

 

 

arrow
arrow
    全站熱搜

    阿貴貴 發表在 痞客邦 留言(0) 人氣()