---
title: "Rails 4.1.1问题记录"
author: "pluto418"
date: "2014-05-31T16:18:16Z"
tags: []
categories: ["企业架构"]
slug: "rails-4-1-1"
draft: false
lastmod: "2014-05-31T16:18:16Z"
id: 2074494
url: "https://pluto418.iteye.com/blog/2074494"
---

运行环境 WIN8.1 64bit、Ruby 64bit

1、问题一 zonetime

启动报

gems/2.0.0/gems/tzinfo-1.2.0/lib/tzinfo/data\_source.rb:182:in \`rescue in create\_default\_data\_source': No source of timezone data could be found. (TZInfo::DataSourceNotFound)  
Please refer to [http://tzinfo.github.io/datasourcenotfound](http://tzinfo.github.io/datasourcenotfound) for help resolving this error.  
 from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.2.0/lib/tzinfo/data\_source.rb:179:in \`create\_default\_data\_source'

 

在GemFile增加

gem 'tzinfo-data', platforms: \[:mingw, :mswin, :x64\_mingw]

 

2、问题二

正常启动后，页面访问报

  &lt;%= stylesheet\_link\_tag    "application", media: "all", "data-turbolinks-track" =&gt; true %&gt;  
  &lt;%= javascript\_include\_tag "application", "data-turbolinks-track" =&gt; true %&gt;  
  &lt;%= csrf\_meta\_tags %&gt;

js找不到

 

execjs跟Win8有点兼容性的问题。

execjs 现在默认使用Windows自带的CScript，但是Win8下CScript 默认接受js编码是UTF-8, 而之前的CScript接受的是ASCII/GBK, 或者用`//U`参数后接受UTF-8，解决方法是

修改execjs gem 路径下 execjs\\runtimes.rb

JScript = ExternalRuntime.new(  
    :name =&gt; "JScript",  
    :command =&gt; "cscript //E:jscript //Nologo //U",  
    :runner\_path =&gt; ExecJS.root + "/support/jscript\_runner.js",  
    :encoding =&gt; 'UTF-16LE'  
)  
改成  
JScript = ExternalRuntime.new(  
  :name        =&gt; "JScript",  
  :command     =&gt; "cscript //E:jscript //Nologo",  
  :runner\_path =&gt; ExecJS.root + "/support/jscript\_runner.js",  
   :encoding    =&gt; 'UTF-8'  
)

[https://github.com/sstephenson/execjs/issues/111](https://github.com/sstephenson/execjs/issues/111%E8%BF%99%E4%B8%AA%E4%B8%8A%E9%9D%A2%E6%9C%89%E4%B8%80%E4%BA%9B%E4%BB%8B%E7%BB%8D)

这个上面有一些介绍。