だいぶ期間が空いてしまったけど…早速使ってみる。
小遣い管理システム作るぞー。
(railsのmanページに乗ってたURL:http://guides.rubyonrails.org/getting_started.htmlを参照した)
まず、ブログ領域を作成。
$ rails new testmoneycreatecreate READMEcreate Rakefilecreate config.rucreate .gitignorecreate Gemfilecreate appcreate app/controllers/application_controller.rbcreate app/helpers/application_helper.rbcreate app/views/layouts/application.html.erbcreate app/mailerscreate app/modelscreate configcreate config/routes.rbcreate config/application.rbcreate config/environment.rbcreate config/environmentscreate config/environments/development.rbcreate config/environments/production.rbcreate config/environments/test.rbcreate config/initializerscreate config/initializers/backtrace_silencers.rbcreate config/initializers/inflections.rbcreate config/initializers/mime_types.rbcreate config/initializers/secret_token.rbcreate config/initializers/session_store.rbcreate config/localescreate config/locales/en.ymlcreate config/boot.rbcreate config/database.ymlcreate dbcreate db/seeds.rbcreate doccreate doc/README_FOR_APPcreate libcreate lib/taskscreate lib/tasks/.gitkeepcreate logcreate log/server.logcreate log/production.logcreate log/development.logcreate log/test.logcreate publiccreate public/404.htmlcreate public/422.htmlcreate public/500.htmlcreate public/favicon.icocreate public/index.htmlcreate public/robots.txtcreate public/imagescreate public/images/rails.pngcreate public/stylesheetscreate public/stylesheets/.gitkeepcreate public/javascriptscreate public/javascripts/application.jscreate public/javascripts/controls.jscreate public/javascripts/dragdrop.jscreate public/javascripts/effects.jscreate public/javascripts/prototype.jscreate public/javascripts/rails.jscreate scriptcreate script/railscreate testcreate test/performance/browsing_test.rbcreate test/test_helper.rbcreate test/fixturescreate test/functionalcreate test/integrationcreate test/unitcreate tmpcreate tmp/sessionscreate tmp/socketscreate tmp/cachecreate tmp/pidscreate vendor/pluginscreate vendor/plugins/.gitkeep
次はbundler(Gem 管理ツール)のセットアップ。
$ bundle installFetching source index for http://rubygems.org/Using rake (0.8.7)Using abstract (1.0.0)Using activesupport (3.0.1)Using builder (2.1.2)Using i18n (0.4.1)Using activemodel (3.0.1)Using erubis (2.6.6)Using rack (1.2.1)Using rack-mount (0.6.13)Using rack-test (0.5.6)Using tzinfo (0.3.23)Using actionpack (3.0.1)Using mime-types (1.16)Using polyglot (0.3.1)Using treetop (1.4.8)Using mail (2.2.7)Using actionmailer (3.0.1)Using arel (1.0.1)Using activerecord (3.0.1)Using activeresource (3.0.1)Using bundler (1.0.3)Using thor (0.14.3)Using railties (3.0.1)Using rails (3.0.1)Using sqlite3-ruby (1.3.1)Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
次にrakeコマンドで、データベースを作成。
$ rake db:create [~/testmoney](in /Users/***/testmoney)/Library/Ruby/Gems/1.8/gems/bundler-1.0.3/lib/bundler/runtime.rb:132: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
これで準備完了!(さすがrails!!)
サーバを起動してみる。
$ rails server/Library/Ruby/Gems/1.8/gems/railties-3.0.1/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777/Library/Ruby/Gems/1.8/gems/bundler-1.0.3/lib/bundler/runtime.rb:132: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777=> Booting WEBrick=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000=> Call with -d to detach=> Ctrl-C to shutdown server[2010-10-26 00:37:45] INFO WEBrick 1.3.1[2010-10-26 00:37:45] INFO ruby 1.8.7 (2009-06-12) [universal-darwin10.0][2010-10-26 00:37:45] INFO WEBrick::HTTPServer#start: pid=4063 port=3000
無事にサーバが見れてよかったです。
次回は、いよいよチューニング!
# ここまでは、マニュアル通りだもんね…。
0 件のコメント:
コメントを投稿