2009-08-11

    RoR环境配置 - [Ruby on Rails]

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://webpeipei.blogbus.com/logs/43940105.html

    Ruby的安装
    1. One key install ruby.exe
    2. "gem update ruby"
    3. "ruby -v" view the version, version diplayed if install successfully
    4. 再升级一下gem, "gem update --system"

    Rails的安装
    1. "gem install rails --remote"
    2. "gem update rails" 升级成新的rails
    3. "rails -v" view the version, version diplayed if install successfully

    数据库连接
    1. Install MySQL/SQLite drivers
      MySQL下的 libmySQL.dll Copy to Ruby/Bin directory
      download sqlite.dll Copy to Ruby/Bin directory
       "gem install mysql"   --安装mysql驱动
       "gem install --version1.2.3 sqlite3-ruby" ----安装sqlite驱动,如果不用则不需要安装

        一般来说如都要把MySQL/bin/libmySQL.dll copy到 Ruby/bin去,当然如果你不做在Ruby script/server的时候都会有提示说缺少libmySQL.dll. 如果有问题的时候,看看server报的错就能解决问题了.

    New program
    "rails app"
    "cd app"
    "ruby script\server"
    Vist http://localhost:3000 点击“About your application's enviroment"查看环境

    Database Config

    config/database.yml file config your default data adapter
    ------------------------------

    我是用MySQL,示例如下:
      development:
      adapter: mysql
      encoding: utf8
      reconnect: false
      database: depot_development
      pool: 5
      username: root
      password:
      host: localhost

      对于RoR环境的配置总的来说很简单,只是数据库的配置比较麻烦,因为需要安装MySQL的驱动,以及MySQL驱动对Mysql版本的兼容支持性, 如果有问题可以发邮件给我大家一起研究下.


    收藏到:Del.icio.us




    引用地址: