sh 在fedora上使用rbenv安装rails的脚本(正在进行跨平台工作)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在fedora上使用rbenv安装rails的脚本(正在进行跨平台工作)相关的知识,希望对你有一定的参考价值。

# Install all prerequisites
os=$(awk -F= '/^NAME/{print $2}' /etc/os-release)

yum install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec $SHELL

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash

source ~/.bashrc

# Install the ruby version which you want 
rbenv install 2.3.1 
rbenv global 2.3.1

gem install rails -v 4.2.1 --no-ri --no-rdoc 
#modify this to take versions in cmd argument
# This should be get enough to get rails up and running in fedora 


# TODO: 
# Make this a generic script to run on both debian as well as rpm based systems. 
# Make it fail safe. If some step fails in the middle then add capability to resume 
# from the failed step instead of starting from beginning. 



以上是关于sh 在fedora上使用rbenv安装rails的脚本(正在进行跨平台工作)的主要内容,如果未能解决你的问题,请参考以下文章

sh rbenv在Ubuntu 14.04 LTS上安装ruby 2.3.0

如何使用 rbenv 在 Ubuntu 21.1 上安装 Ruby 2.3.0?

sh 使用Rbenv安装Ruby

sh 通过rbenv安装ruby

sh 在Fedora或RHEL上安装ElasticSearch

为 Ruby on Rails 6 创建弹性 beanstalk 环境时遇到问题(rvm、rbenv、.ruby-version 问题)