- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有很多需要支持的音频文件名,都是用中文拼音写的,例如wǒ shì xuésheng.mp3
.将这些转换为 Assets 路径或处理生成的路径似乎存在问题,因为
http://localhost:3000/assets/wǒ shì xuésheng.mp3
http://localhost:3000/assets/w%C7%92+sh%C3%AC+xu%C3%A9sheng.mp3
http://localhost:3000/assets/w%C7%92%20sh%C3%AC%20xu%C3%A9sheng.mp3
ma ma.mp3
的文件。在同一目录中,并且该目录加载正常,因此问题似乎出在文件名中的 Unicode 字符上。
File.exists?(File.join(Rails.root, "/app/assets/audios/", "wǒ shì xuésheng.mp3"))
http://localhost:3000/assets/bù.mp3
** Invoke assets:precompile (first_time)
** Execute assets:precompile
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe C:/RailsInstaller/Ruby1.9.3/bin/rake assets:precompile:all RAILS_ENV=produ
ction RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
undefined method `directory?' for nil:NilClass
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:189:in `block in each_en
try'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:185:in `each_entry'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_fi
le'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_pat
h'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/static_compiler.rb:18:in `comp
ile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:56:in `internal_pr
ecompile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:70:in `block (3 le
vels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call
_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:60:in `block (3 le
vels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call
_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) i
n top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level
'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception
_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe C...]
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:55:in `block in create_shel
l_runner'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `sh'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `sh'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:82:in `ruby'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `ruby'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:12:in `ruby_rake_t
ask'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:21:in `invoke_or_r
eboot_rake_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.15/lib/sprockets/assets.rake:29:in `block (2 le
vels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call
_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) i
n top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level
'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception
_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile
最佳答案
Rails 3.2.x 补丁版本中已经有大量错误修复,可能已经解决了这个问题。这里的其他帖子暗示升级到 3.2.14 修复了这个 UTF-8 URL 编码问题。
我建议升级到 Rails 3.2.15
(当前补丁版本)以查看此问题是否已解决。
关于ruby-on-rails - 如何使用涉及 Unicode 的 Assets 名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21111435/
我在我的应用程序中使用rails 4 和 ruby 1.9.3 以及fancybox2-rails gem,但是 Assets 管道存在一个普遍问题。如果我运行 rake task 进行预编译,那
我把我所有的 Assets 都放在我的包里例如myBundle/Resources/public/css/ 然后像这样加载它们: {% block stylesheets %} {{ parent()
我正在创建RoR-6应用程序,并从此行的application.html.erb文件中引发以下错误: javascript_include_tag 'application', 'data-turbo
我正在对 Play Subproject 功能进行更多扩展测试,如下所述:http://www.playframework.com/documentation/2.0/SBTSubProjects .
我是 symfony 2 和 Assetic 的新手。我想在 CSS 中使用 assetic 和 Sass。我使用自定义字体。我在资源下的包中创建文件夹“assets/css”,里面有 _base.s
这是我的目录结构(这只是一个测试项目): stan@mypc:/generate_assets$ sudo tree -L 3 -p . ├── [drwxr-xr-x] assets │ └─
我使用 node.js connect/express。 有人知道支持 TypeScript 源代码即时编译和缩小的 Assets 管理器吗? 知道如何以编程方式调用编译器吗? 我一直在使用 conn
因此,我们在 Assets 管道摘要方面遇到了一个小问题,因为我们有许多 HTML 模板作为 Assets (对于 AngularJS),并且我们使用 asset_path 在 Javascript
我想从iPad的照片库中获取图像URL。 当我尝试从Image Piicker的信息中获取 UIImagePickerControllerReferenceURL 时 我将URL设为: assets
我正在使用带有Assetic的Symfony 2.1.10版,并且在上次 Composer 更新之后,当我尝试运行php app/console assetic:dump时出现以下错误 Dumping
我的 Assets 管道有问题,我已经有一个名为 Assets 的资源/ Controller 。所以我已将 assets.prefix 选项更改为“/externals”。 config.asset
更新到 Expo sdk 34 后,出现此错误:TypeError:Asset.fromModule 不是函数。 (在“Asset.fromModule(image)”中,“Asset.fromMod
将 Play 框架项目从 2.2.4 迁移到 2.3.8 后遇到问题: 这是运行命令“activatorcompile”的错误输出: [error] ...\workspace\testproject
我在将 Google Analytics 添加到我的 Rails 4 应用程序时遇到了一些困难(参见 this post)。 我通过在 /public/assets/google-analytics.
我正在使用 Symfony2 和 Assetic。最近我一直在做很多 CSS 工作,所以在某个时候我需要命令 $ php app/console assetic:dump --env=prod --n
我正在 Android 开发中迈出第一步,并遇到了 Assets 一词。 据我了解, Assets 只是一个未被解析或引用为资源的文件。 这个词有更准确的定义吗?我应该在哪些情况下在我的应用程序中使用
我添加了 danial-farid--angular-file-upload通过 Rails Assets 将库添加到我的 Rails 4 应用程序。主库加载正常,但 sprockets 找不到它包含
这是我的代码,尽管编码非常粗糙: public void loadStack(AssetManager manager, String path) { String[] lis
我正在使用 Assets 管理我的 Symfony 2 框架中的 CSS 文件。它在生产模式下运行良好。 我的问题是在 Debug模式下,assetic 不断将我的文件合并为一个输出文件。这使得跟踪特
我想以编程方式从重复的相册中删除 Assets (照片不是)。我可以使用照片框架删除相册 我想知道如何从相册中删除 Assets 而不从照片应用中完全删除它。我想在多个地方使用它,例如将 Assets
我是一名优秀的程序员,十分优秀!