2009年4月26日日曜日

rails/info/properties was not found on this server.

前回、やっとできたと思ったrailsですが、
About your application’s environment
のリンクをクリックすると
Not Found
The requested URL /hello/rails/info/properties was not found on this server.

なんてエラーが。。。

設定がまだ足りなかったみたいです。
という事で設定を追加!

configの中にあるenvironment.rbをviとかで開く。
  1. %cd $HOME/rails-apl/hello/config/  
  2. %vi environment.rb  

で、冒頭に以下を追加。
  1. $LOAD_PATH.push("/home/xxxxx/lib/ruby/site_ruby/1.8")  
  2. $LOAD_PATH.push("/home/xxxxx/lib/ruby")  
  3. ENV['GEM_HOME'] ||= '/home/xxxxx/lib/ruby/gem'  
  4. ENV['RAILS_RELATIVE_URL_ROOT']="/hello"  

さらにpublicの中にある.htaccessをviとかで開く。
。。と思ったら.htaccessがない!
READMEに書かれてるっぽいのでコピーして.htaccessファイルを作成する。
中身は以下のような感じだと思います。
  1. # General Apache options  
  2. AddHandler fastcgi-script .fcgi  
  3. AddHandler cgi-script .cgi  
  4. Options +FollowSymLinks +ExecCGI  
  5. # If you don't want Rails to look in certain directories,  
  6. # use the following rewrite rules so that Apache won't rewrite certain requests  
  7. ## Example:  
  8. #   RewriteCond %{REQUEST_URI} ^/notrails.*  
  9. #   RewriteRule .* - [L]  
  10.   
  11. # Redirect all requests not available on the filesystem to Rails  
  12. # By default the cgi dispatcher is used which is very slow  
  13. ## For better performance replace the dispatcher with the fastcgi one  
  14. ## Example:  
  15. #   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]  
  16. RewriteEngine On  
  17.   
  18. # If your Rails application is accessed via an Alias directive,  
  19. # then you MUST also set the RewriteBase in this htaccess file.  
  20. ## Example:  
  21. #   Alias /myrailsapp /path/to/myrailsapp/public  
  22. #   RewriteBase /myrailsapp  
  23. RewriteRule ^$ index.html [QSA]  
  24. RewriteRule ^([^.]+)$ $1.html [QSA]  
  25. RewriteCond %{REQUEST_FILENAME} !-f  
  26. RewriteRule ^(.*)$ dispatch.cgi [QSA,L]  
  27.   
  28. # In case Rails experiences terminal errors  
  29. # Instead of displaying this message you can supply a file here which will be rendered instead  
  30. ## Example:  
  31. #   ErrorDocument 500 /500.html  
  32. ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"  

で、最初の2行目から4行目までをコメントアウト
  1. #AddHandler fastcgi-script .fcgi  
  2. #AddHandler cgi-script .cgi  
  3. #Options +FollowSymLinks +ExecCGI  

すると今度は
Not Found
The requested URL /hello/dispatch.cgi was not found on this server.

。。。なんだこりゃ。。。まだ設定不足?
これはまた次回ってことで!

↓ランキング参加中!ポチッとお願いします。
ブログランキング・にほんブログ村へ人気ブログランキングへ

0 件のコメント:

コメントを投稿