Posted at


More than 3 years have passed since last update.




  • ubuntu Server 14.04LTS

  • Unicorn

  • MongoDB 3.0

  • Ruby 2.2.2

  • Ruby on Rails 4.2.3


Vagrant立ち上げ〜Ruby on Railsインストールまで

% vagrant init precise64 

% vagrant up
% vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)

* Documentation:
New release '14.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 06:23:18 2012 from

$ do-release-upgrade
% vagrant ssh
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-65-generic x86_64)

* Documentation:
Welcome to your Vagrant-built virtual machine.
Last login: Sun Oct 11 01:40:33 2015 from

$ apt-get update

$ sudo aptitude purge ruby

#install rbenv
$ sudo apt-get install rbenv

#install git
$ sudo apt-get install git

#install ruby-build
$ git clone ~/.rbenv/plugins/ruby-build

#insall Ruby2.2.2
$ rbenv install 2.2.2
Downloading ruby-2.2.2.tar.gz...
-> 5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44
Installing ruby-2.2.2...

BUILD FAILED (Ubuntu 14.04 using ruby-build 20150928-2-g717a54c)

Inspect or clean up the working tree at /tmp/ruby-build.20151011034515.2028
Results logged to /tmp/ruby-build.20151011034515.2028.log

#check error log
$ vi /tmp/ruby-build.20151011034515.2028.log
checking if make is GNU make... ./configure: line 23197: make: command not found

#install make
$ apt-get install make

$ rbenv install 2.2.2
Installed ruby-2.2.2 to /root/.rbenv/versions/2.2.2

#use global
$ rbenv global 2.2.2
$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

$ vi ~/.gemrc
install: --no-ri --no-rdoc
update: --no-ri --no-rdoc

#install Ruby on Rails
$ gem install rails --version="4.2.3"

$ rbenv rehash


#installe ImageMagick

$ aptitude install imagemagick libimagemagick libmagickcore libmagickcore-dev libmagickwand-dev

#install mongoDB
$ apt-get install mongodb-10gen
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-10gen

#Retry install mongoDB
$ apt-key adv --keyserver hkp:// --recv 7F0CEB10
$ echo "deb trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
$ apt-get install -y mongodb-org

#install bundler
$ gem install bundler

#install SHIRASAGI
$ git clone -b stable --depth 1 /var/www/shirasagi

#IF install OpenData Plugin
$ git clone -b stable --depth 1 /var/www/shirasagi

$ cd /var/www/shirasagi
$ cp -n config/samples/*.{yml,rb} config/
$ bundle install
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/root/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20151011-19263-xj6a5.rb extconf.rb
checking for main() in -lstdc++... no
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
make: g++: Command not found
make: *** [unf.o] Error 127

make failed, exit code 2

Gem files will remain installed in /root/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unf_ext- for inspection.
Results logged to /root/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/unf_ext-
An error occurred while installing unf_ext (, and Bundler cannot continue.
Make sure that `gem install unf_ext -v ''` succeeds before bundling.

$ apt-get install build-essential g++
$ bundle install

$ rake unicorn:start





$ ps -ef | grep unicorn

vagrant 22083 1 6 16:42 ? 00:00:10 unicorn_rails master -c /var/www/shirasagi/config/unicorn.rb -E production -D
vagrant 22090 22083 0 16:42 ? 00:00:00 unicorn_rails worker[0] -c /var/www/shirasagi/config/unicorn.rb -E production -D
vagrant 22093 22083 0 16:42 ? 00:00:00 unicorn_rails worker[1] -c /var/www/shirasagi/config/unicorn.rb -E production -D