Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?


More than 3 years have passed since last update.

rbenvは複数ユーザーで共有したいので、/usr/local/rbenv にインストールすることにします。


install necessary packages

$ sudo apt-get -y install libssl-dev zlib1g-dev libreadline-dev libmysqlclient-dev sqlite3 libsqlite3-dev g++ git curl

install rbenv

$ cd /usr/local
$ sudo git clone git://github.com/sstephenson/rbenv.git rbenv

make export path setting

--no-rehash をつけないとログインのたび rehash するので遅くなるそうです。

export RBENV_ROOT="/usr/local/rbenv"
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init --no-rehash -)"

load setting

$ source /etc/profile.d/rbenv.sh

confirm rbenv installed

$ type rbenv

install ruby-build

$ sudo git clone git://github.com/sstephenson/ruby-build.git rbenv/plugins/ruby-build

install Ruby

# rbenv install 2.3.1
# rbenv global 2.3.1

install bundler

# gem install bundler --no-ri --no-rdoc

install Rails

$ mkdir project
$ cd project
$ bundle init
source "https://rubygems.org"

gem "rails"


$ bundle install --path vendor/bundle
$ bundle exec rails new .


bundle install で An error occurred while installing pg (0.17.1) というエラーが起きた時の対処


$ sudo apt-get install postgresql-9.3
$ sudo apt-get install libpq-dev
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away