勉強したことのメモ

Webエンジニア / プログラマが勉強したことのメモ。

ServersManのVPSにRuby on Railsを導入する方法

   2024/01/24  VPS Ruby

Ruby on Railsを導入した際のメモ。Cens OSのバージョンは6.3で64bitです。

 

必要なものをインストール

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
yum install zlib-devel openssl-devel sqlite-devel
curl -L https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 1.9.3
gem install --no-ri --no-rdoc sqlite3
rpm --import https://fedoraproject.org/static/0608B895.txt
rpm -Uvh http://download-i2.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install nodejs npm --enablerepo=epel
yum install npm --enablerepo=epel
gem install rails
yum install zlib-devel openssl-devel sqlite-devel curl -L https://get.rvm.io | bash -s stable source /etc/profile.d/rvm.sh rvm install 1.9.3 gem install --no-ri --no-rdoc sqlite3 rpm --import https://fedoraproject.org/static/0608B895.txt rpm -Uvh http://download-i2.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm yum install nodejs npm --enablerepo=epel yum install npm --enablerepo=epel gem install rails
yum install zlib-devel openssl-devel sqlite-devel
curl -L https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 1.9.3
gem install --no-ri --no-rdoc sqlite3
rpm --import https://fedoraproject.org/static/0608B895.txt
rpm -Uvh http://download-i2.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install nodejs npm --enablerepo=epel
yum install npm --enablerepo=epel
gem install rails

 

iptableで3000番ポートの開放

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
service iptables restart
vi /etc/sysconfig/iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT service iptables restart
vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
service iptables restart

 

一旦サーバー再起動

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
reboot
reboot
reboot

 

Ruby on Railsがちゃんと入ったか確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
rails -v
rails -v
rails -v

 

参考サイト

http://dotinstall.com/lessons/basic_sakura_vps/

https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

 - VPS Ruby

  関連記事

RubyでCookieを指定した上でスクレイピングする方法

Rubyで通販サイトの特定ページから価格部分のみを抽出したかった。そのサイトでは ...

Rubyで基本的な構文のメモ

Railsを勉強する前にRubyの基本的な構文だけは抑えておこうと思ったのでメモ ...

Rubyで日時とファイルの取扱い

Rubyで日時を取得して整形した上で、指定したファイルに追記していきたかった。以 ...

Rubyでサイトの死活管理を行いGmailのSMTPサーバ経由で通知メールを送る方法

Rubyの勉強で何かツールを作ろうと考えた。また、Railsとかは使わず素のRu ...

S