ปัญหาการลง kv บน debian testing

6 views
Skip to first unread message

unticha

unread,
Jul 12, 2008, 2:11:22 AM7/12/08
to kv-thai
สวัสดีค่ะ
ดิฉันพยายามลง kv ตามนี้เว็บ http://rd.cc.psu.ac.th/content/view/98/48
ค่ะ ตอนแรกลงบน ubuntu 6.06 ติดปัญหาเยอะ พอสมควร ค้น google ไปมา
ได้เห็นข้อความแนะนำ ว่าลงบน debian ได้ ดิฉันก็เลยลองลงบน debian
testing ก็ประสบปัญหานิดหน่อย ๆ ก็พอผ่านไปได้ แบบไม่ค่อยเข้าใจ
ดิฉันไม่เคยลง ruby มาก่อน ซอฟต์แวร์ที่ลงมีดังนี้ค่ะ
ruby ri rdoc libyaml-ruby libzlib-ruby irb libopenssl-ruby version
4.2 สั่ง apt-get
ruby1.8-dev version 1.8.7.22-1 สั่ง apt-get
memcached version 1.2.2-1 สั่ง apt-get
rubygems-0.9.4.tgz install ด้วยมือ ตามคำแนะนำ
imagemagick 7:6.3.7.9.dfsg1-2+b2 สั่ง apt-get
libmagick9-dev 7:6.3.7.9.dfsg1-2+b2 สั่ง apt-get
mysql-server 5.0.51a-6 สั่ง apt-get
libmysqlclient12-dev 4.0.24-10sarge3 install ด้วยมือ dpkg น่ะค่ะ
libmysql-ruby1.8 2.7.4-1 สั่ง apt-get
apache2 2.2.9-2 สั่ง apt-get
พอประมาณขั้นตอนที่ 14 ก็สั่ง sudo rake db:migrate ได้ error ดังนี้
(in /var/www/html/kv)
rake aborted!
development database is not configured

(See full trace by running task with --trace)
ก่อนหน้านั้นก็ไม่แน่ใจเหมือกันว่ามี error อะไรหรือเปล่า
แต่ก็ลงได้ปกตินะค่ะ
ดิฉันไม่แน่ใจเรียกว่า error หรือเปล่า ก็เลยลองทำขั้นตอนต่อไปเรื่อย ๆ
ดิฉันใช้ apache2 ตามเว็บ แต่เห็นหลายความคิดเห็นให้ใช้ lighthttp จริง ๆ
ใช้ apache ก็ได้ใช่หรือเปล่าค่ะ?
rubygem ที่ลงเป็นดังนี้ค่ะ อ่านวนไปวนมาเลย งง ว่าควรลงตัวไหน
ไม่ควรลงตัวไหน
*** LOCAL GEMS ***

abstract (1.0.0)
a library which enable you to define abstract method in Ruby

actionmailer (2.1.0)
Service layer for easy email delivery and testing.

actionpack (2.1.0)
Web-flow and rendering framework putting the VC in MVC.

activerecord (2.1.0)
Implements the ActiveRecord pattern for ORM.

activeresource (2.1.0)
Think Active Record for web resources.

activesupport (2.1.0)
Support and utility classes used by the Rails framework.

cached_model (1.3.1)
An ActiveRecord abstract model that caches records in memcached

cgi_multipart_eof_fix (2.5.0)
Fix an exploitable bug in CGI multipart parsing.

color-tools (1.3.0)
color-tools provides colour space definition and manpiulation as
well as commonly named RGB colours.

daemons (1.0.10)
A toolkit to create and control daemons in different ways

erubis (2.6.2)
a fast and extensible eRuby implementation which supports
multi-language

fastthread (1.0.1)
Optimized replacement for thread.rb primitives

gd2 (1.1.1)
Ruby interface to gd 2 library.

gem_plugin (0.2.3)
A plugin system based on rubygems that uses dependencies only

gettext (1.90.0)
Ruby-GetText-Package is a libary and tools to localize messages.

hoe (1.7.0)
Hoe is a simple rake/rubygems helper for project Rakefiles

io-reactor (0.05)
An implementation of the Reactor design pattern for multiplexed
asynchronous single-thread IO.

memcache-client (1.5.0)
A Ruby memcached client

mongrel (1.1.5)
A small fast HTTP library and server that runs Rails, Camping,
Nitro
and Iowa apps.

mongrel_cluster (1.0.5)
Mongrel plugin that provides commands and Capistrano tasks for
managing multiple Mongrel processes.

rails (2.1.0)
Web-application framework with template engine, control-flow
layer,
and ORM.

rake (0.8.1)
Ruby based make-like utility.

RedCloth (3.0.4)
RedCloth is a module for using Textile and Markdown in Ruby.
Textile
and Markdown are text formats. A very simple text format. Another
stab at making readable text that can be converted to HTML.

rmagick (2.5.1)
Ruby binding to ImageMagick

rubyforge (1.0.0)
A script which automates a limited set of rubyforge operations

sources (0.0.1)
This package provides download sources for remote gem installation

ZenTest (3.10.0)
ZenTest provides 4 different tools and 1 library: zentest,
unit_diff, autotest, multiruby, and Test::Rails
ตอนรัน script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.1.0 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with production environment...
Exiting
/usr/lib/ruby/gems/1.8/gems/cached_model-1.3.1/lib/cached_model.rb:77:
1.90.0 is not a class/module (TypeError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
32:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
32:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:509:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:354:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:509:in `require'
from /var/www/html/kv/config/environment.rb:58
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:509:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:354:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:509:in `require'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
mongrel/rails.rb:147:in `rails'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/
mongrel_rails:113:in `cloaker_'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
configurator.rb:149:in `call'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
configurator.rb:149:in `listener'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/
mongrel_rails:99:in `cloaker_'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
configurator.rb:50:in `call'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
configurator.rb:50:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/
mongrel_rails:84:in `new'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/
mongrel_rails:84:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/
mongrel_rails:281
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:502:in `load'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:502:in `load'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:354:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:502:in `load'
from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/
servers/mongrel.rb:64
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:509:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:354:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/
active_support/dependencies.rb:509:in `require'
from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/
server.rb:39
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
from script/server:3
รบกวนด้วยนะค่ะ ขอบพระคุณค่ะ
อันธิฌา

unticha

unread,
Jul 12, 2008, 2:41:29 AM7/12/08
to kv-thai


On Jul 12, 1:11 pm, unticha <unti...@gmail.com> wrote:
> สวัสดีค่ะ
> ดิฉันพยายามลง kv ตามนี้เว็บhttp://rd.cc.psu.ac.th/content/view/98/48
> => Rails 2.1.0 application starting onhttp://0.0.0.0:3000
ขั้นตอนที่ 14 ตอน config file เป็น
production:
adapter: mysql
database: kv_production
#database: kv_development
username: kv
password: 1234567
host: localhost
encoding: utf8
ดิฉันสร้าง database kv_production ต้อง config ตามข้างบนใช่มั้ยค่ะ?
รบกวนด้วยค่ะ ขอบคุณค่ะ

unticha

unread,
Jul 12, 2008, 2:48:58 AM7/12/08
to kv-thai
> ดิฉันสร้าง database kv_production ต้อง config ...
>
> read more >>
ดิฉนยังอยู่ขั้นตอนที่ 14
sudo rake --trace db:schema:load
(in /var/www/html/kv)
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
development database is not configured
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/connection_specification.rb:218:in
`establish_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/connection_specification.rb:209:in
`establish_connection'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:332:in
`initialize_database'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:120:in
`process'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in
`send'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run'
/var/www/html/kv/config/environment.rb:12
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:354:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/misc.rake:3
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in
`invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in
`invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in
`invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
/usr/bin/rake:16:in `load'
/usr/bin/rake:16
รบกวนด้วยนะค่ะ

unticha pramgoed

unread,
Jul 12, 2008, 2:53:22 AM7/12/08
to kv-thai
ดิฉันลองสั่ง sudo mongrel_rails start -e production -p 8000
** Starting Mongrel listening at 0.0.0.0:8000

** Starting Rails with production environment...
/usr/lib/ruby/gems/1.8/gems/cached_model-1.3.1/lib/cached_model.rb:77: 1.10.0 is not a class/module (TypeError)

        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'

        from /var/www/html/kv/config/environment.rb:58
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:147:in `rails'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
        from /usr/bin/mongrel_rails:16:in `load'
        from /usr/bin/mongrel_rails:16


เมื่อ กรกฎาคม 12, 2008 1:48 หลังเที่ยง, unticha <unt...@gmail.com> เขียนว่า:

unticha pramgoed

unread,
Jul 12, 2008, 3:03:20 AM7/12/08
to kv-thai
ทดสอบผลงานโดยทำงานบน server
ใช้ browser บน server ตัวนี้ เปิดเวบ http://localhost:8000
ปรากฎว่า ไม่ได้หน้าโฮมเพจ KnowledgeVolution แต่ได้รายชื่อไฟล์ ที่อยู่ใน public directory ค่ะ
404.html  500.html  dispatch.cgi  dispatch.fcgi  dispatch.rb  favicon.ico  images  javascripts  robots.txt  stylesheets  themes
รบกวนขอคำแนะนำด้วยค่ะ ขอบคุณคะ

เมื่อ กรกฎาคม 12, 2008 1:53 หลังเที่ยง, unticha pramgoed <unt...@gmail.com> เขียนว่า:

Surakarn Samkaew

unread,
Jul 13, 2008, 11:21:23 PM7/13/08
to kv-...@googlegroups.com
สวัสดีครับ

ขอตอบรวมๆ เลยนะครับ อ่าน log แล้วตาลาย : )
  1. มีเหตุผลที่ลงบน Ubuntu 6.06 ไหมครับ? .. ถ้าต้องการ LTS ใช้ตัวล่าสุด 8.04 ดีกว่าครับ เพราะดีกว่าแทบทุกอย่าง
  2. ลงบน OS ตระกูล *nix ได้ทุกตัวครับ ไม่จำเพาะ Debian แต่ถ้าใช้ Debian based จะได้ข้อดีตรงที่ติดตั้ง package ง่ายกว่า
  3. ต้องขอชี้แจงว่าคู่มือตามลิงก์ ซึ่งจัดทำโดยคุณวิภัทรนั้นค่อนข้างเก่าแล้วครับ ลองมาใช้วิธีโหดของผมดู
  4. วิธีโหด -- ติดตั้ง ruby, rubygems, build-essential, imagemagick, libmagick9-dev, libmysql-ruby1.8 (และอื่นๆ ที่มัน require) ผ่านทาง apt-get หรือ aptitude
  5. สั่ง $ sudo gem update --system เพื่ออัพเกรด gem ให้เป็นเวอร์ชัน 1.x ซึ่งได้แก้บั๊กของ 0.9x ไปเยอะพอสมควร
  6. $ sudo gem install rails
  7. $ sudo gem install mongrel
  8. ติดตั้งไปทีละตัวครับ ไม่ต้องรีบร้อน จะได้เห็น error ที่มันแจ้งได้ชัดเจน ... บน development ใช้ mongrel ตัวเดียวพอครับ ไม่ต้องใช้ apache
  9. ติดตั้ง mysql สร้าง database ชื่อ kv_development (or up to you) ให้เรียบร้อย พร้อมทั้งแก้ไข config/database.yml, config/kv.rb ตามอัธยาศัย
  10. สั่ง script/server แล้วดู error ที่ปรากฏ มันจะบอกว่าเราขาด package ตัวไหนไปบ้าง
  11. ถ้าขาดบน rails system ก็ติดตั้งผ่าน gem ... ถ้าขาดบน os system ก็ติดตั้งผ่าน apt
  12. ขออภัยที่ต้องให้ใช้วิธีนี้ครับ เพราะผมเองก็ไม่เคยจำว่าต้องติดตั้งอะไรบ้าง ลอง script/server ไปเรื่อยๆ จนกว่าจะไม่มี error นั่นแหละครับ .. จบวิธีโหด
  13. ถ้ามีปัญหาขั้นตอนไหนก็สอบถามมาอีกนะครับ
ขอให้โชคดี
สุรกานต์

--
Surakarn Samkaew
Software Engineer / Researcher
http://usablelabs.org

wip...@psu.ac.th

unread,
Jul 14, 2008, 3:47:02 AM7/14/08
to kv-...@googlegroups.com
เรียน ทุกท่าน

โปรดอย่าใช้ เอกสาร http://rd.cc.psu.ac.th/content/view/98/48
เพราะเก่าแล้ว ตามที่คุณสุรกานต์แนะนำ
ไว้วันหลัง ผมมีเวลาแล้วค่อยทดสอบและปรับปรุงเอกสารใหม่ครับ

ผมได้คุยกับ อ.ธวัชชัย ว่าอนาคตผมอาจจะทำเป็นในรุ่นของ PSU Open Server
เพื่อให้ผู้ใช้ติดตั้งได้ง่ายและรวดเร็วครับ

--วิภัทร

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
สวัสดีครับ

ขอตอบรวมๆ เลยนะครับ อ่าน log แล้วตาลาย : )

1. มีเหตุผลที่ลงบน Ubuntu 6.06 ไหมครับ? .. ถ้าต้องการ LTS ใช้ตัวล่าสุด


8.04 ดีกว่าครับ เพราะดีกว่าแทบทุกอย่าง

2. ลงบน OS ตระกูล *nix ได้ทุกตัวครับ ไม่จำเพาะ Debian แต่ถ้าใช้ Debian


based จะได้ข้อดีตรงที่ติดตั้ง package ง่ายกว่า

3. ต้องขอชี้แจงว่าคู่มือตามลิงก์


ซึ่งจัดทำโดยคุณวิภัทรนั้นค่อนข้างเก่าแล้วครับ ลองมาใช้วิธีโหดของผมดู

4. วิธีโหด -- ติดตั้ง ruby, rubygems, build-essential, imagemagick,


libmagick9-dev, libmysql-ruby1.8 (และอื่นๆ ที่มัน require) ผ่านทาง apt-get
หรือ aptitude

5. สั่ง $ sudo gem update --system เพื่ออัพเกรด gem ให้เป็นเวอร์ชัน 1.x


ซึ่งได้แก้บั๊กของ 0.9x ไปเยอะพอสมควร

6. $ sudo gem install rails
7. $ sudo gem install mongrel
8. ติดตั้งไปทีละตัวครับ ไม่ต้องรีบร้อน จะได้เห็น error


ที่มันแจ้งได้ชัดเจน ... บน development ใช้ mongrel ตัวเดียวพอครับ
ไม่ต้องใช้
apache

9. ติดตั้ง mysql สร้าง database ชื่อ kv_development (or up to you)


ให้เรียบร้อย พร้อมทั้งแก้ไข config/database.yml, config/kv.rb ตามอัธยาศัย

10. สั่ง script/server แล้วดู error ที่ปรากฏ มันจะบอกว่าเราขาด package
ตัวไหนไปบ้าง
11. ถ้าขาดบน rails system ก็ติดตั้งผ่าน gem ... ถ้าขาดบน os system


ก็ติดตั้งผ่าน apt

12. ขออภัยที่ต้องให้ใช้วิธีนี้ครับ


เพราะผมเองก็ไม่เคยจำว่าต้องติดตั้งอะไรบ้าง ลอง script/server ไปเรื่อยๆ
จนกว่าจะไม่มี error นั่นแหละครับ .. จบวิธีโหด

13. ถ้ามีปัญหาขั้นตอนไหนก็สอบถามมาอีกนะครับ

ขอให้โชคดี
สุรกานต์

--
Surakarn Samkaew
Software Engineer / Researcher
http://usablelabs.org

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

unticha pramgoed

unread,
Jul 14, 2008, 10:33:28 AM7/14/08
to kv-...@googlegroups.com
พอสั่ง
sudo script/server
** Starting Rails with development environment...
  SQL (0.000135)   SET NAMES 'utf8'
  SQL (0.000081)   SET SQL_AUTO_IS_NULL=0
  SQL (0.000137)   SELECT version FROM schema_migrations

Exiting
/usr/lib/ruby/gems/1.8/gems/cached_model-1.3.1/lib/cached_model.rb:77: 1.90.0 is not a class/module (TypeError)
ไม่ทราบว่าต้องแกไขยังไงเหรอค่ะ ขอโทษค่ะ พอดีไม่มีประสบการณ์การลง ROR เลย T_T

เมื่อ กรกฎาคม 14, 2008 2:47 หลังเที่ยง, <wip...@psu.ac.th> เขียนว่า:

Surakarn Samkaew

unread,
Jul 14, 2008, 10:31:20 PM7/14/08
to kv-...@googlegroups.com
เปิดไฟล์ /usr/lib/ruby/gems/1.8/gems/cached_model-1.3.1/lib/cached_model.rb
ดู error บรรทัดที่ 77

ให้ comment if-else loop เหลือไว้เฉพาะบรรทัด self.abstract_class = true

ผมไม่สามารถหาสาเหตุ error ได้ รู้แค่ว่าส่วนนี้มันทำการเช็คว่า Rails เป็นรุ่นสูงกว่า 1.1.2 หรือไม่ ซึ่งเราใช้ 2.1 แล้ว ก็ไม่น่าจะมีปัญหา จึงทำการ comment ส่วน error ดังกล่าวครับ

unticha pramgoed

unread,
Jul 14, 2008, 10:43:31 PM7/14/08
to kv-...@googlegroups.com
ได้แล้วค่ะ ขอบคุณมากๆ ๆๆๆๆค่ะ

เมื่อ กรกฎาคม 15, 2008 9:31 ก่อนเที่ยง, Surakarn Samkaew <ton...@gmail.com> เขียนว่า:

unticha pramgoed

unread,
Jul 14, 2008, 11:06:12 PM7/14/08
to kv-...@googlegroups.com
เราต้องสังรัน script/server ตลอดเวลาเหรอค่ะ?

เมื่อ กรกฎาคม 15, 2008 9:43 ก่อนเที่ยง, unticha pramgoed <unt...@gmail.com> เขียนว่า:

unticha pramgoed

unread,
Jul 14, 2008, 11:41:42 PM7/14/08
to kv-...@googlegroups.com
อยากเปลี่ยนการเรียกผ่านเว็บจาก http://ip:3000 http://ip ทำไงเหรอค่ะ?

เมื่อ 7/15/08, unticha pramgoed <unt...@gmail.com> เขียนว่า:

unticha

unread,
Jul 15, 2008, 12:28:29 AM7/15/08
to kv-thai
ถ้าเราต้องการกำหนดชื่อ link อย่างไรเหรอค่ะ เช่นถ้าลองบนเครื่อง pc
เราเรียกผ่าน ip ได้เลย แต่ที่นี่ต้องการเรียก เป็น http://www.server.com/kv
แบบนี้ต้องไปกำหนดค่ะ comfig ที่ไหนบ้างเหรอค่ะ แล้วต้องถ้าต้องการเอา :
3000 ต้องกำหนดที่ไหนบ้างเหรอค่ะ?
ขอบคุณค่ะ

On Jul 15, 10:41 am, "unticha pramgoed" <unti...@gmail.com> wrote:
> อยากเปลี่ยนการเรียกผ่านเว็บจากhttp://ip:3000http://ipทำไงเหรอค่ะ?
>
> เมื่อ 7/15/08, unticha pramgoed <unti...@gmail.com> เขียนว่า:
>
> > เราต้องสังรัน script/server ตลอดเวลาเหรอค่ะ?
>
> > เมื่อ กรกฎาคม 15, 2008 9:43 ก่อนเที่ยง, unticha pramgoed <unti...@gmail.com>

unticha

unread,
Jul 17, 2008, 1:34:16 AM7/17/08
to kv-thai
ทำได้เรียบร้อยแล้วค่ะ ขอบคุณมากค่ะ
เดี๋ยวจะเรียบเรียงวธีการทำและการอธิบายก่อนนะค่ะ
แล้วจะเอาวิธีทำมาเล่าให้ฟัง
ขอบคุณอีกครั้งค่ะ :D
> เราเรียกผ่าน ip ได้เลย แต่ที่นี่ต้องการเรียก เป็นhttp://www.server.com/kv
Reply all
Reply to author
Forward
0 new messages