我使用Base64编码此Userdata脚本,以便在初始化EC2实例时运行,但由于某种原因,它不会安装RVM。我认为这是针对用户问题的,但我不确定。
我正在使用12.10默认的Ubuntu AMI。
#!/bin/bash
export LC_ALL=en_US.UTF-8
sudo apt-get --yes update
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
sudo apt-get --yes --fix-missing install mongodb language-pack-en ruby-full build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config tcptrack
\curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
source ~/.profile
rvm autolibs 3
rvm requirements
#source ~/.profile
rvm install 2.0.0-p0
rvm --default use 2.0.0
gem update --system
gem i mechanize peach mongo rails aws-sdk bson_ext httparty