ksaitoの日記

日々試したことの覚え書き

rvm

ruby-rvmパッケージをインストールしようとしましたがインストール出来ませんでした。
バグデータベースにレポートがありUbuntu 12.04でadminグループがsudoグループに変更されたことに対応できていないのが原因のようです。

rails環境準備

rvmでRails環境を準備するには追加パッケージがいくつか必要になります。

$ rvm use 1.9.3
$ rvm use 1.9.3 --passenger
NOTE: If you are using Passenger 3 you no longer need the passenger_ruby,
use the wrapper script for your ruby instead (see 'rvm wrapper')
$ gem install passenger
$ rvmsudo passenger-install-nginx-module
Welcome to the Phusion Passenger Nginx module installer, v3.0.12.

This installer will guide you through the entire installation process. It
shouldn't take more than 5 minutes in total.

Here's what you can expect from the installation process:

 1. This installer will compile and install Nginx with Passenger support.
 2. You'll learn how to configure Passenger in Nginx.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.
1

--------------------------------------------

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * The 'make' tool... found at /usr/bin/make
 * A download tool like 'wget' or 'curl'... found at /usr/bin/wget
 * Ruby development headers... found
 * OpenSSL support for Ruby... not found
 * RubyGems... found
 * Rake... found at ~/.rvm/wrappers/ruby-1.9.3-p194/rake
 * rack... found
 * Curl development headers with SSL support... not found
 * OpenSSL development headers... not found
 * Zlib development headers... found

Some required software is not installed.
But don't worry, this installer will tell you how to install them.

Press Enter to continue, or Ctrl-C to abort.

不足しているパッケージをインストールしても、rvmでインストールしたrubyを再インストールしないとライブラリを正しく認識してくれません。

$ sudo apt-get install libssl-dev libcurl4-openssl-dev libopenssl-ruby
$ rvm remove 1.9.3
$ rvm install 1.9.3
$ rvm use 1.9.3
$ rvm use 1.9.3 --passenger
$ gem install passenger
$ rvmsudo passenger-install-nginx-module
Welcome to the Phusion Passenger Nginx module installer, v3.0.12.

This installer will guide you through the entire installation process. It
shouldn't take more than 5 minutes in total.

Here's what you can expect from the installation process:

 1. This installer will compile and install Nginx with Passenger support.
 2. You'll learn how to configure Passenger in Nginx.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.
1

--------------------------------------------

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * The 'make' tool... found at /usr/bin/make
 * A download tool like 'wget' or 'curl'... found at /usr/bin/wget
 * Ruby development headers... found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at ~/.rvm/wrappers/ruby-1.9.3-p194/rake
 * rack... found
 * Curl development headers with SSL support... found
 * OpenSSL development headers... found
 * Zlib development headers... found

--------------------------------------------

Automatically download and install Nginx?

Nginx doesn't support loadable modules such as some other web servers do,
so in order to install Nginx with Passenger support, it must be recompiled.

Do you want this installer to download, compile and install Nginx for you?

 1. Yes: download, compile and install Nginx for me. (recommended)
    The easiest way to get started. A stock Nginx 1.0.15 with Passenger
    support, but with no other additional third party modules, will be
    installed for you to a directory of your choice.

 2. No: I want to customize my Nginx installation. (for advanced users)
    Choose this if you want to compile Nginx with more third party modules
    besides Passenger, or if you need to pass additional options to Nginx's
    'configure' script. This installer will  1) ask you for the location of
    the Nginx source code,  2) run the 'configure' script according to your
    instructions, and  3) run 'make install'.

Whichever you choose, if you already have an existing Nginx configuration file,
then it will be preserved.

Enter your choice (1 or 2) or press Ctrl-C to abort: