LoginSignup
0
0

More than 5 years have passed since last update.

Virtual Boxでローカル環境を作る初心者メモその3

Last updated at Posted at 2018-09-20

前回前々回

  • MacOS High SierraにVirtual BoxとVagrantをインストールして、Vagrantを使ってVirtual BoxにCentOSを乗せつつ、IPアドレスを192.168.33.10に設定。

  • sshでCentOSにログインし、ドットインストールのリポジトリを使ってApache、Rubyその他アプリケーションをインストール。

しました。

今回はその続きです。CentOSにVimとRailをインストールして、rbenvでRubyのバージョンもあげました。

Vim

Vimと仲良くなりたいのでVimを入れる。
こちらの記事でそのままでできました。👉 CentOS に Vim をインストール

Vimのバージョン確認

$ yum list installed | grep vim
Failed to set locale, defaulting to C
vim-minimal.x86_64     2:7.2.411-1.8.el6

必要なパッケージが入ってるか確認

$ yum list installed | grep mercurial
$ yum list installed | grep ncurses-devel
$ yum list installed | grep make         
$ yum list installed | grep gcc 

入ってなかったのはインストール

$ yum install mercurial
$ yum install ncurses-devel
$ yum install make
$ yum install gcc

/usr/local/srcの下のvimというディレクトリ内にリポジトリを複製

$ cd /usr/local/src
$ sudo hg clone https://bitbucket.org/vim-mirror/vim vim

そこに移動して中身見てみる

$ cd vim
$ ls

複製してからリポジトリが更新されてないか確認する

$ sudo hg pull
pulling from https://bitbucket.org/vim-mirror/vim
searching for changes
no changes found

makeする

$ sudo ./configure --with-features=huge --enable-multibyte --disable-selinux
$ sudo make
$ sudo make install

確認

vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar  1 2015 06:42:11)

vimrcはあとで。とりあえず簡単なテキストならCyberduckでいちいちファイル開かなくてもVimで更新できそう。

rubyのバージョンをあげる

$ ruby -v

2.3.1 でした。2.4.1にしたい。
ドットインストール見てバージョンあげます。

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build 
$ git pull origin master
$ rbenv install 2.4.1
$ rbenv global 2.4.1
$ rbenv rehash
$ ruby -v

2.4.1になりました。

Railsをインストール

ドットインストールです。

# その前にSQLiteがインストールされてるか確認

$ sqlite3 --version

3.6.20入ってます。

# gemでインストール

$ gem install rails --no-document
$ rails -v

2.3.1が入りました。

ここまで。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0