ApacheでRuby on Railsを動かすとき、の環境構築について教えてください。
ApacheでPassengerを入れて、httpd.confの編集まで行い、DocumentRootをvar/www/html/app/publicに設定しました。
しかしこれではpublicの静的ページへアクセスはできても、route.rbで定義されたapp/views/index/index.html.erbへのアクセスができません。
rails sで動作していたrouteでビューにアクセスする場合、他に何か設定が必要なのでしょうか?
追記:
passengerのインストールは下記の手順で行いました。
・gem install passenger
・passenger-install-apache2-module
・httpd.confの編集
httpd.conf
1<VirtualHost *:80> 2 RailsEnv production 3 PassengerRuby /home/vagrant/.rbenv/shims/ruby 4 RackBaseURI / 5 ServerName test.com 6 DocumentRoot /var/www/html/testapp/public 7 8 <Directory /var/www/html/testapp/public> 9 Require all granted 10 AllOverride all 11 Options -MultiViews 12 </Directory> 13</VirtualHost> 14 15LoadModule passenger_module /home/vagrant/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/passenger-5.1.8/buildout/apache2/mod_passenger.so 16 17<IfModule mod_passenger.c> 18 PassengerRoot /home/vagrant/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/passenger-5.1.8 19 PassengerDefaultRuby /home/vagrant/.rbenv/versions/2.4.1/bin/ruby 20</IfModule>
回答4件
あなたの回答
tips
プレビュー