Windows7Ruby2.0Ruby on Rails4.0Ƥߤޤ

ʤꥶåȤǤåץǡȤƤꤴʾWebˤʤäΤǡƤޤ

(ʲ̵ݾڡ2013-11)

ñʼȤƤϡRuby 󥹥ȡ for WindowsǤˡ

RailsInstallerhttp://www.forest.impress.co.jp/docs/review/20120418_526822.htmlˤǤˡä

ԤΤۤñץ륢ץդƤ롣

ɡRailsInstallerǤȥС󤬸ŤΤȡgemΥɤɤߤäΤǡԤǤäƤߤ

Ruby󥹥ȡƳ

  1. http://rubyinstaller.org/
  2. rubyinstaller-2.0.0-pXXX.exe
  3. ɥե¹

󥹥ȡϡC:\Ruby200ȤƤߤ ǡRubyƳơRubyޥɥץץȤ顢Ȥ褦ˤʤä

gemΥåץǡ

  1. RubyޥɥץץȤư
  2. gem update --system

DevKitƳ

󥹥ȡϡC:\Ruby200\devkit Ȥ

  1. ʬWindows32bitǤ64bitǤǧƤ http://support.microsoft.com/kb/958406/ja
  2. ١http://rubyinstaller.org/
  3. Development Kitɡ32bitRuby 2.064bitRuby 2.0
  4. ɤDevKitե¹ԡ󥹥ȡϡc:\Ruby200\devkit
  5. RubyޥɥץץȤǡDevKitΥ󥹥ȡ˰ư cd c:\Ruby200\devkit
  6. ruby dk.rb init
  7. ruby dk.rb install

gemSSL顼

ΤȡĤRubyѥå򥤥󥹥ȡ/åץǡȤȤgemSSL顼Ф礬롣

μDz򤹤롣

  1. ʲΥc:\Ruby200\cacert.pemפȤ¸
  2. RubyޥɥץץȤǡsetx SSL_CERT_FILE "C:\Ruby200\cacert.pem"פȤơĶѿ
  3. RubyޥɥץץȤƵư

RailsƳ

äRailsƳȤޤ褿

⤷ȡĤפʼ礬뤫⡣

  1. gem update rake
  2. gem install rails --platform=ruby

(ʤ֤)

ץκ

ѤˡSitesץեѰդơˡfooץץ

  1. cd \
  2. mkdir Sites
  3. cd Sites
  4. rails new foo --skip-bundle
  5. cd foo
  6. bundle install
  7. rails g scaffold user name:string email:string
  8. rake db:migrate

ưǧ

  1. rails s
  2. Web֥饦ǡhttp://localhost:3000/users˥
  3. ³ǤޤǤפȥ顼Ǥȡ̥ɥ"³ޤ"ȤǤOK
  4. Listing usersפȤФĥڡɽ줿顢New Userץ󥯤򥯥å
  5. Nameˤʤ̾EmailˤʤΥ᡼륢ɥ쥹ϤCreate Userץܥ򥯥å

ڡξˡUser was successfully created.פɽ OK

Ǵ

ץߤȤϡctrl-c


  ȥå   ʬ Хåå   ñ측 ǽ   إ   ǽRSS
Last-modified: 2013-11-09 () 01:44:08 (1993d)