fc2ブログ

Ruby on RailsでWebサイト公開!に挑戦中

レンタルサーバーでWebサイトを公開すべく、Ruby on Railaの勉強をする日々を語ります。

| PAGE-SELECT | NEXT

≫ EDIT

Railsアプリの移行テスト④ PassengerをRubyGemsでインストール

今回は、Phusion PassengerをRubyGemsでインストール



1)Ruby環境の確認

$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]

$ rvm list
=* ruby-2.0.0-p648 [ x86_64 ]
ruby-3.0.0 [ x86_64 ]

$ rvm gemset list
gemsets for ruby-2.0.0-p648 (found in /home/test/.rvm/gems/ruby-2.0.0-p648)
=> (default)
global
ruby2rails4

2)使用するgemsetsを切り替える

$ rvm gemset use ruby2rails4
Using ruby-2.0.0-p648 with gemset ruby2rails4

$ rvm gemset list
gemsets for ruby-2.0.0-p648 (found in /home/test/.rvm/gems/ruby-2.0.0-p648)
(default)
global
=> ruby2rails4

$ echo $GEM_HOME
/home/test/.rvm/gems/ruby-2.0.0-p648@ruby2rails4

3)passenger4.0.55をインストール

$ gem install passenger -v 4.0.55

ERROR: Error installing passenger:
The last version of rack (>= 0) to support your Ruby & RubyGems was 1.6.13. Try installing it with `gem install rack -v 1.6.13` and then running the current command again

4)rack1.6.13をインストール

$ gem install rack -v 1.6.1

5)passenger4.0.55をインストール

$ gem install passenger -v 4.0.55
 :
Successfully installed daemon_controller-1.2.0
Successfully installed passenger-4.0.55

6)"passenger-install-apache2-module"を実行

$ passenger-install-apache2-module

Welcome to the Phusion Passenger Apache 2 module installer, v4.0.55.

Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /home/test/.rvm/gems/ruby-2.0.0-p648@ruby2rails4/gems/passenger-4.0.55/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/test/.rvm/gems/ruby-2.0.0-p648@ruby2rails4/gems/passenger-4.0.55
PassengerDefaultRuby /home/test/.rvm/gems/ruby-2.0.0-p648@ruby2rails4/wrappers/ruby
</IfModule>

Suppose you have a web application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

<VirtualHost *:80>
ServerName www.yourhost.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /somewhere/public
<Directory /somewhere/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>

| インストール | 14:20 | comments:0 | trackbacks:0 | TOP↑

COMMENT















非公開コメント

TRACKBACK URL

http://hbnist76.blog.fc2.com/tb.php/578-903a815b

TRACKBACK

| PAGE-SELECT | NEXT