[英]Ruby on Rails 4 select schema_migrations Error
Guy today i was open old Ruby project after copy the files to my Sites folder then run this commands 伙计,今天,我将文件复制到我的Sites文件夹中后,打开旧的Ruby项目,然后运行此命令
bundle
rake db:create
rake db:migrate
rails s
when i was open my project on the browser i found the project gives me errors because MySQL not work with me also i got this error on the console 当我在浏览器上打开项目时,我发现该项目给了我错误,因为MySQL无法与我一起使用,我也在控制台上收到了此错误
ActiveRecord::SchemaMigation Load (68.0ms) select 'schema_migrations'.* from 'schema_migrations'
processing by HomeController#index as HTML
Completed 500 Internal Server Error in 92ms
log writing faild. invalid byte sequence in US-ASCII
so why i got this error and how i can solve that ?? 那么,为什么我会收到此错误以及如何解决呢?
I solved it now 我现在解决了
just to solve the US-ASCII issue i added this line to the first line in my model page 只是为了解决US-ASCII问题,我将此行添加到了模型页面的第一行
#encoding: utf-8
also i added the lines 我也加了线
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
in my Gemfile 在我的Gemfile中
then i got another error told me use protected_attributes
然后我又遇到一个错误,告诉我使用
protected_attributes
so i added the line 所以我加了线
gem 'protected_attributes'
in my Gemfile and then execute: 在我的Gemfile中,然后执行:
$ bundle
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.