2009年4月29日水曜日

sakuraにrails まとめ?-1-

sakuraインターネットにrailsアプリを入れる。。。
いろいろやってごっちゃになったのでまとめ?
MySQL用

%rails todo -d mysql
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log

できたら、config/database.ymlを編集。

development:
adapter: mysql
encoding: utf8
reconnect: false
database: todo_development
pool: 5
username: root
password:
host: localhost

↓↓変更↓↓

development:
adapter: mysql
encoding: utf8
reconnect: false
database: DB名
pool: 5
username: ユーザ名
password: パスワード
host: mysqlXX.sakura.ne.jp

public/.htaccessを作る。

# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
#Options +FollowSymLinks +ExecCGI

ewriteEngine On

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

ErrorDocument 500 "

Application error

Rails application failed to start properly"

次に、logとtmpのパーミッション変更。

%chmod -R o+w log tmp

config/environment.rbの先頭に以下を追加。

$LOAD_PATH.push("/home/xxxxx/lib/ruby")
$LOAD_PATH.push("/home/xxxxx/lib")
ENV['GEM_HOME'] ||= '/home/xxxxx/lib/ruby/gem'
ENV['RAILS_RELATIVE_URL_ROOT']="/todo"


で、シンボリックリンクを張る

%ln -s $HOME/rails-apl/todo/public/ $HOME/www/todo


ここまでやって
Not Found
The requested URL /hello/dispatch.cgi was not found on this server.
と、エラーがでる。。。
未解決中!

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

0 件のコメント:

コメントを投稿