require 'active_record'
require 'yaml'
@db_conf = YAML.load(File.open("config/database.yml"))
ActiveRecord::Base.establish_connection(@db_conf['development'])
class User < ActiveRecord::Base
set_table_name 'lsmp_lottery_user'
alias_attribute :luser_name,'username'
end
运行时提示
C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError)
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:151:in `parse'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:127:in `load'
from C:/Users/xincai/RubymineProjects/jc_autotesting/test.rb:5:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
谁能告诉我是怎么回事啊,。。。急啊 求大神
require 'yaml'
@db_conf = YAML.load(File.open("config/database.yml"))
ActiveRecord::Base.establish_connection(@db_conf['development'])
class User < ActiveRecord::Base
set_table_name 'lsmp_lottery_user'
alias_attribute :luser_name,'username'
end
运行时提示
C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError)
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:151:in `parse'
from C:/Ruby193/lib/ruby/1.9.1/psych.rb:127:in `load'
from C:/Users/xincai/RubymineProjects/jc_autotesting/test.rb:5:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
谁能告诉我是怎么回事啊,。。。急啊 求大神