2010年10月25日月曜日

Rails奮闘記 サーバ立ち上げまで

だいぶ期間が空いてしまったけど…早速使ってみる。
小遣い管理システム作るぞー。
(railsのmanページに乗ってたURL:http://guides.rubyonrails.org/getting_started.htmlを参照した)

まず、ブログ領域を作成。

$ rails new testmoney
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/views/layouts/application.html.erb
create app/mailers
create app/models
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create log
create log/server.log
create log/production.log
create log/development.log
create log/test.log
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create public/images
create public/images/rails.png
create public/stylesheets
create public/stylesheets/.gitkeep
create public/javascripts
create public/javascripts/application.js
create public/javascripts/controls.js
create public/javascripts/dragdrop.js
create public/javascripts/effects.js
create public/javascripts/prototype.js
create public/javascripts/rails.js
create script
create script/rails
create test
create test/performance/browsing_test.rb
create test/test_helper.rb
create test/fixtures
create test/functional
create test/integration
create test/unit
create tmp
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create vendor/plugins
create vendor/plugins/.gitkeep
次はbundler(Gem 管理ツール)のセットアップ。

$ bundle install
Fetching 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 件のコメント:

コメントを投稿