简体   繁体   中英

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

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

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

#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

then i got another error told me use protected_attributes

so i added the line

gem 'protected_attributes'

in my Gemfile and then execute:

$ bundle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM