1> Sqlite3的安装:
http://www.cnblogs.com/answer/archive/2010/02/08/1665737.html
2> NoMethodError in MytestController#index
代码:
class MytestController < ApplicationController
def index
render_text "Hello World!"
end
end
出错信息:
NoMethodError in MytestController#index
undefined method `render_text' for #<MytestController:0x3816728>
RAILS_ROOT: C:/ruby/mybook/mybook
原因:
render_text过时。
更改為:
render:text =>"Hello World!"
3> 中文乱码: (UTF-8)
a.将.rb文件和.rhtml文件都保存为utf-8格式;
b.在/app/Controller/application.rb中增加如下代码:
ruby 代码
before_filter :set_charset
def set_charset
headers["Content-Type"] = "text/html; charset=UTF-8"
end
def set_charset
headers["Content-Type"] = "text/html; charset=UTF-8"
end