我想知道是否有人在生产中使用带有ruby-build的rbenv,以及人们是否可以在他们的经验中提供一些陷阱或见解。
非常感谢。
发布于 2013-03-30 14:46:02
在生产中似乎确实有人在使用rbenv。rbenv documentations说:
你的应用程序的可执行文件就是它与ops的接口。使用rbenv和Bundler binstub,您再也不需要输入cron作业或Chef食谱来确保选择了正确的运行时。Ruby版本依赖项位于一个地方-您的应用程序-因此升级和回滚是原子的,即使您切换版本也是如此
然而,rbenv确实在开发方面出类拔萃,因为它可以方便地使用Ruby的许多版本。
对于生产环境,我经常跳过rbenv,直接使用ruby-build。
此脚本将在Ubuntu上使用ruby-build而不使用rbenv获得一个很好的Ruby:
# The version of Ruby to be installed
ruby_ver="1.9.3-p392"
# The base path to the Ruby
ruby_home="/usr/local"
# Packages needed to build Ruby
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev
# Use ruby-build to install Ruby
clone_dir=/tmp/ruby-build-$$
git clone https://github.com/sstephenson/ruby-build.git $clone_dir
$clone_dir/bin/ruby-build "$ruby_ver" "$ruby_home"
rm -rf $clone_dir
unset clone_dirhttps://stackoverflow.com/questions/15715090
复制相似问题