About your application’s environment
のリンクをクリックすると
Not Found
The requested URL /hello/rails/info/properties was not found on this server.
なんてエラーが。。。
設定がまだ足りなかったみたいです。
という事で設定を追加!
configの中にあるenvironment.rbをviとかで開く。
%cd $HOME/rails-apl/hello/config/
%vi environment.rb
で、冒頭に以下を追加。
$LOAD_PATH.push("/home/xxxxx/lib/ruby/site_ruby/1.8")
$LOAD_PATH.push("/home/xxxxx/lib/ruby")
ENV['GEM_HOME'] ||= '/home/xxxxx/lib/ruby/gem'
ENV['RAILS_RELATIVE_URL_ROOT']="/hello"
さらにpublicの中にある.htaccessをviとかで開く。
。。と思ったら.htaccessがない!
READMEに書かれてるっぽいのでコピーして.htaccessファイルを作成する。
中身は以下のような感じだと思います。
# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
## Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]
# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
## For better performance replace the dispatcher with the fastcgi one
## Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
## Example:
# Alias /myrailsapp /path/to/myrailsapp/public
# RewriteBase /myrailsapp
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
## Example:
# ErrorDocument 500 /500.html
ErrorDocument 500 "Application error
Rails application failed to start properly"
で、最初の2行目から4行目までをコメントアウト
#AddHandler fastcgi-script .fcgi
#AddHandler cgi-script .cgi
#Options +FollowSymLinks +ExecCGI
すると今度は
Not Found
The requested URL /hello/dispatch.cgi was not found on this server.
。。。なんだこりゃ。。。まだ設定不足?
これはまた次回ってことで!
↓ランキング参加中!ポチッとお願いします。
0 件のコメント:
コメントを投稿