#PassengerのApacheモジュールインストール
$ passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v4.0.7.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
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.
--------------------------------------------
Checking for required software...
* Checking for GNU C compiler...
Found: yes
Location: /usr/bin/gcc
* Checking for GNU C++ compiler...
Found: yes
Location: /usr/bin/g++
* Checking for Curl development headers with SSL support...
Found: no
Error: Cannot find the `curl-config` command.
* Checking for OpenSSL development headers...
Found: yes
Location: true
* Checking for Zlib development headers...
Found: yes
Location: true
* Checking for Ruby development headers...
Found: yes
Location: /usr/local/include/ruby-2.0.0/ruby.h
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Rake (associated with /usr/local/bin/ruby)...
Found: yes
Location: /usr/local/bin/ruby /usr/local/bin/rake
* Checking for rack...
Found: yes
* Checking for Apache 2...
Found: yes
Location of httpd: /usr/sbin/httpd
Apache version: 2.2.15
* Checking for Apache 2 development headers...
Found: no
* Checking for Apache Portable Runtime (APR) development headers...
Found: no
* Checking for Apache Portable Runtime Utility (APU) development headers...
Found: no
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.
--------------------------------------------
Installation instructions for required software
* To install Curl development headers with SSL support:
Please install it with yum install curl-devel
* To install Apache 2 development headers:
Please install it with yum install httpd-devel
* To install Apache Portable Runtime (APR) development headers:
Please install it with yum install apr-devel
* To install Apache Portable Runtime Utility (APU) development headers:
Please install it with yum install apr-util-devel
If the aforementioned instructions didn't solve your problem, then please take
a look at the Users Guide:
/usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.7/doc/Users guide Apache.html
#再びPassengeのApacheモジュールインストール
$ passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v4.0.7.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
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.
--------------------------------------------
Checking for required software...
* Checking for GNU C compiler...
Found: yes
Location: /usr/bin/gcc
* Checking for GNU C++ compiler...
Found: yes
Location: /usr/bin/g++
* Checking for Curl development headers with SSL support...
Found: yes
curl-config location: /usr/bin/curl-config
Header location: somewhere, not sure where
Version: libcurl 7.19.7
Usable: yes
Supports SSL: yes
* Checking for OpenSSL development headers...
Found: yes
Location: true
* Checking for Zlib development headers...
Found: yes
Location: true
* Checking for Ruby development headers...
Found: yes
Location: /usr/local/include/ruby-2.0.0/ruby.h
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Rake (associated with /usr/local/bin/ruby)...
Found: yes
Location: /usr/local/bin/ruby /usr/local/bin/rake
* Checking for rack...
Found: yes
* Checking for Apache 2...
Found: yes
Location of httpd: /usr/sbin/httpd
Apache version: 2.2.15
* Checking for Apache 2 development headers...
Found: yes
Location of apxs2: /usr/sbin/apxs
* Checking for Apache Portable Runtime (APR) development headers...
Found: yes
Location: /usr/bin/apr-1-config
Version: 1.3.9
* Checking for Apache Portable Runtime Utility (APU) development headers...
Found: yes
Location: /usr/bin/apu-1-config
Version: 1.3.9
--------------------------------------------
Compiling and installing Apache 2 module...
…
(省略)
…
--------------------------------------------
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.7/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.7
PassengerDefaultRuby /usr/local/bin/ruby
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
Press ENTER to continue.
--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Rails 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
</Directory>
</VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:
/usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.7/doc/Users guide Apache.html
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
#Railsアプリケーションの作成
$ rails new testapp
…
(省略)
…
run bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
…
(省略)
…
Installing sqlite3 (1.3.7)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
#yumコマンドで「sqlite3」を検索
$ yum search sqlite3
sqlite-devel.i686 : Development tools for the sqlite3 embeddable SQL database engine
sqlite-tcl.i686 : Tcl module for the sqlite3 embeddable SQL database engine
#yumコマンドで「sqlite3-devel」をインストール
$ yum install sqlite-devel
#ディレクトリ移動
$ cd testapp/
#再度「bundle install」実行
$ bundle install
続いて、Scaffoldを使用して1機能作成する。
DB作成は本番環境を作成する。
また、本番環境をプリコンパイルする。
Apacheで参照される環境はデフォルトが本番環境のようなので、ここで本番環境のDB作成とプリコンパイルをしておかないと「We’re sorry, but something went wrong.」でページが開けなかった。
コメント