rails invalid byte sequence in US-ASCII
2016-05-11 00:00
435 查看
摘要: https://ruby-china.org/topics/25052 http://hearrain.com/2013/04/738 http://stackoverflow.com/questions/17031651/invalid-byte-sequence-in-us-ascii-argument-error-when-i-run-rake-dbseed-in-ra
You're receiving an encoding error because your filesystem isn't configured to encode the date you've added (since presumably it includes new characters – possibly in your HTML entity encoded map URL – that didn't exist in your prior data seed).
The following will should resolve this error by setting the UTF-8 locale on your machine:
The benefit of setting a system locale is that all gems (going forward) will be bundled using UTF-8 encoding.
EDIT:
Alternatively, if you don't want to change your system encoding, you can set your encoding project-wide by specifying an encoding standard in your Gemfile:
You're receiving an encoding error because your filesystem isn't configured to encode the date you've added (since presumably it includes new characters – possibly in your HTML entity encoded map URL – that didn't exist in your prior data seed).
The following will should resolve this error by setting the UTF-8 locale on your machine:
# from your command line export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 bundle
The benefit of setting a system locale is that all gems (going forward) will be bundled using UTF-8 encoding.
EDIT:
Alternatively, if you don't want to change your system encoding, you can set your encoding project-wide by specifying an encoding standard in your Gemfile:
if RUBY_VERSION =~ /1.9/ # assuming you're running Ruby ~1.9 Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8 end
相关文章推荐
- Java中String、StringBuffer、StringBuilder简述及区别
- iOS9开发最简单的设置导航栏透明UINavigationBar透明
- 在Android Studio中进行单元测试和UI测试
- Android高级UI控件—ListView
- Queue.Queue vs collections.deque
- UIKIT点击事件中的职责链模式
- nessue6.6.2安装与离线激活
- UE4:旋转导致包围球体半径变化
- STL系列之三 queue 单向队列
- EasyUI学习笔记
- Glib学习(3) 双端队列 Double-ended Queues
- 一款FireBird3的GUI编辑器:FireBird Maestro V15.11.0.4
- iOS开发之基础视图——UITextField
- iOS开发 - 第01篇 - UI基础 - 04 - 超级猜图
- UIImage加载图片的方式以及Images.xcassets对于加载方法的影响
- 解决IOS8.1中UIActionSheet与UIPickerView不兼容
- Resolve Gradle Build Running stuck on Ubuntu 14
- 图形用户界面GUI
- j2ee四大作用域pagecontext,request,session,ServletContext
- iOS开发之基础视图——UIButton