想知道到Fedora ruby工程系统的真相么,想知道Fedora ruby工程系统中藏有的内在奥义么,只有我来给大家全面讲解介绍Fedora ruby工程系统***个工程建立rails工程rails --Fedora ruby工程=path 工程锁在的path修改environment里的database.yml然后做例子重启服务器Fedora ruby工程 script\server关闭control c访问地址http://localhost:3000/chinese/list
- ruby script\generate model paper修改db\migrate\新的rb文件,里边加:t.column :name,:string
- rake db:migrate
- ruby script\generate controller paper
- ruby script\generate scaffold paper paper
fc6更方便的安装包下一个yumexsudo yum install yumex在yumex可以直接选一个安装用yum的话就要输命令字体问题操作系统语言选择了english,中文就变成了乱码。
需要安装字体* 字体安装将Microsoft Windows(windows\fonts\)的相应TrueType拷贝到Fedora ruby工程相应目录。我是放在/usr/share/fonts/windows目录下。然后以root执行下面的命令
- cd /usr/share/fonts/windows
- ttmkfdir .
- cp fonts.scale fonts.dir
- chkfontpath --add /usr/share/fonts/windows
以下是我安装的字体文件
- (Arial) - arial.ttf arialbd.ttf arialbi.ttf ariali.ttf
- (Tahoma) - tahoma.ttf tahomabd.ttf
- (Verdana) - verdana.ttf verdanab.ttf verdanai.ttf verdanaz.ttf
- (GB) - simsun.ttc
- (BIG5) - mingliu.ttc
装了gb和big5后,网页和openoffice里的中文就没问题了。开发oracle应用需安装OCI从http://Fedora ruby工程forge.org/frs/?group_id=256&release_id=12694上下载然后cmd中运行 Fedora ruby工程 ruby-oci8-1.0.0-rc3-mswin32.rb即安装成功,就可以rake db:migrate了.
- http://www.railsapi.org/activerecord-base-set_primary_key
- set_primary_key
- Description
- set_primary_key(value = nil, &block)
- Sets the name of the primary key column to use to the given value, or (if the value is nil or false) to the value returned by the given block.
- Examples: add
- Suggest an example
- Examples currently must be approved.
- This means that when you submit the example, it will not show up on this page until approved (generally 24 hours)
- Enclose ruby in <code> tags to get it syntax highlighted.
- Description
- or Cancel
- Example:
- class Project < ActiveRecord::Base
- set_primary_key "sysid"
- end
- User Contributed Notes add
- Add Comment
- Name
- Title
- Body
- or Cancel
- No comments
【编辑推荐】