私の持っている環境のひとつ、さくらのVPSに某プロジェクトでRuby on Railsが必要なのでインストール
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
==========
叩くとエラー
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
185 185 185 185 0 0 562 0 --:--:-- --:--:-- --:--:-- 1850
bash: line 1: html: そのようなファイルやディレクトリはありません
bash: line 2: 期待してない token `<' のあたりにシンタックスエラー
'ash: line 2: `
==========
301だし一時的に落ちてるとかじゃないだろうな
rvmで入れようにも、1.8は使わないだろうしftpで持ってきて入れちゃおうか思案
ただ上記を実際にcurlで持ってくると中身は
==========
#!/usr/bin/env bash
printf "%b" "
Deprecated command, please use:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
"
false
==========
なので
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
に変更だろうなと検討をつけビンゴ。
==========
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Installing RVM to /usr/local/rvm/
Creating RVM system user group 'rvm'
# RVM: Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.io/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Cheatsheet: http://cheat.errtheblog.com/s/rvm/
# Screencast: http://screencasts.org/episodes/how-to-use-rvm
# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'
Installation of RVM in /usr/local/rvm/ is almost complete:
* First you need to add all users that will be using rvm to 'rvm' group,
and logout - login again, anyone using rvm will be operating with `umask g+w`.
* To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# root,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne
rvm 1.13.8 (stable) by Wayne E. Seguin
==========
$ source /etc/profile.d/rvm.sh
して、念の為
$ yum install openssl-devel readline-devel zlib-devel
も入れて
$ rvm install 1.9.3
すると無事エラーもなくruby1.9.3p194が入りました。
gemは
$ gem -v
1.8.24
あとは
$ gem install rails --no-ri --no-rdoc
してrailsも入れます。
sqliteでなくmysqlを使うことが多いので、
rails new project -d mysql
とするのですが、mysql2はうまく入らないことが多い...
gem install mysql2
だとエラーが出て、
gem install mysql2 --with-mysql-include=/usr/include/mysql
と、PATHを指定してあげる必要あり。
特に几帳面に最低限のパッケージしか入れていない方は
/usr/include/mysql
自体がなかったりします。
その場合は
$ yum install --enablerepo=remi mysql-devel
で入れてあげる必要ありです。
その後無事
new project -d mysql
が通ります
現在記事を書いている段階での最新環境であるruby1.9とrails3.3の組み合わせが問題なく動作するさくらのVPSはおオススメです。
2012年3月以前までであれば値段見合いで迷うところでしたが、3月からのスペックアップでだいぶ安くなりましたね。
以前は自宅にサーバ置いて
「自宅データセンター」「自宅第一NOC」
と言っていた方もここまで下がったら、さくらのVPSを借りてしまったほうがトータルでは安上がりでしょうね。