インスタンスを作成直後から、以下の操作を実施。
メモついでの記録です。
管理者権限で色々インストール
$ sudo su# yum install httpd curl mysqlclient-dev mysql-server nodejs
# exit
RVMをインストール
公式を参考に。$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) $ source /home/ec2-user/.rvm/scripts/rvm
RVMでRubyをインストール(失敗)
$ rvm install 1.9.3Fetching yaml-0.1.4.tar.gz to /home/ec2-user/.rvm/archives Extracting yaml-0.1.4.tar.gz to /home/ec2-user/.rvm/src Configuring yaml in /home/ec2-user/.rvm/src/yaml-0.1.4. Error running ' ./configure --prefix="/home/ec2-user/.rvm/usr" ', please read /home/ec2-user/.rvm/log/ruby-1.9.3-p125/yaml/configure.log Compiling yaml in /home/ec2-user/.rvm/src/yaml-0.1.4. Error running 'make ', please read /home/ec2-user/.rvm/log/ruby-1.9.3-p125/yaml/make.log Database file /home/ec2-user/.rvm/config/packages does not exist. Installing Ruby from source to: /home/ec2-user/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)... ruby-1.9.3-p125 - #fetching ruby-1.9.3-p125 - #downloading ruby-1.9.3-p125, this may take a while depending on your connection... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 9505k 100 9505k 0 0 3216k 0 0:00:02 0:00:02 --:--:-- 3247k ruby-1.9.3-p125 - #extracting ruby-1.9.3-p125 to /home/ec2-user/.rvm/src/ruby-1.9.3-p125 ruby-1.9.3-p125 - #extracted to /home/ec2-user/.rvm/src/ruby-1.9.3-p125 ruby-1.9.3-p125 - #configuring Error running ' ./configure --prefix=/home/ec2-user/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/home/ec2-user/.rvm/usr ', please read /home/ec2-user/.rvm/log/ruby-1.9.3-p125/configure.log There has been an error while running configure. Halting the installation.ここでおっとっと。
Makeとgccをインストール。
$ sudo su# yum install make gcc
# exit
気を取り直してもう一度。
$ rvm install 1.9.3ここでお茶を。
$ rvm --default 1.9.3
$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
$ which ruby
~/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
Railsをインストール(失敗)
$ gem install railsERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
ここでおっとっと。zlib-develなどをインストール
$ sudo su# yum install zlib-devel
# exit
$ cd /home/ec2-user/.rvm/src/ruby-1.9.3-p125/ext/zlib
$ ruby extconf.rb
checking for deflateReset() in -lz... yes checking for zlib.h... yes checking for kind of operating system... Unix checking for crc32_combine() in zlib.h... yes checking for adler32_combine() in zlib.h... yes creating Makefile
$ make
compiling zlib.c linking shared-object zlib.so
$ make install
/usr/bin/install -c -m 0755 zlib.so /home/ec2-user/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/x86_64-linux installing default zlib libraries
気を取り直してもう一度。
$ gem install railsここでまたお茶を。
$ which rails
~/.rvm/gems/ruby-1.9.3-p125/bin/rails
$ rails -v
Rails 3.2.2
完了。
環境:
- Server: EC2
- Type: t1.micro
- OS: Basic Amazon Linux AMI 2011.09
- Ruby: 1.9.3-p125
- Rails: 3.2.2
0 件のコメント:
コメントを投稿