使用 therubyracer 在 Windows 机器上安装 ruby​​ gem less-rails

使用 therubyracer 在 Windows 机器上安装 ruby​​ gem less-rails

问题描述:

有一段时间我试图在我的 windows7 机器上安装 less-rails gem.

since a while I am trying to install the less-rails gem on my windows7 machine.

我已经设法使用这个二进制文件安装了所需的 therubyracer.gem:https://github.com/stereobooster/therubyracer/downloads

I already managed to install the needed therubyracer.gem using this binary file: https://github.com/stereobooster/therubyracer/downloads

我还下载了 v8.dll 并放在了我的 ruby​​/bin 目录中.到目前为止一切正常,捆绑安装正在运行,服务器启动没有任何问题.

I also downloaded the v8.dll and put in my ruby/bin directory. So far everything works well, the bundle install is running and the server starting without any problems.

但是一旦我使用较少的文件请求页面,我就会收到以下错误消息

But as soon as I request a page using a less file I get the following error message

未定义的方法`in_javascript?'for #"<"V8::Error: [object Object]>

undefined method `in_javascript?' for #"<"V8::Error: [object Object]>

我的 css.file 几乎是空的

My css.file is alomst empty

/*
*= require 'custom_less/custom'
*= require 'jquery-ui-1.8.24.custom'
*/

custom.css.less 看起来像这样

The custom.css.less looks like this

@import "twitter/bootstrap/reset";
@import "twitter/bootstrap/variables";
@import "custom_less/variables";                 // Your own variable overrides.
@import "twitter/bootstrap/mixins";
@import "custom_less/mixins";                    // Your own mixin.
@import "twitter/bootstrap/scaffolding";
@import "twitter/bootstrap/grid";
@import "twitter/bootstrap/layouts";
//import of further bootstrap components
//but nothing else

我在 ruby​​ 1.9.3 中使用 rails 安装程序.

I am using the rails installer with ruby 1.9.3.

这样的问题描述不多.我发现的所有问题都通过更新到至少 ruby​​ 1.9.2 来解决.但不幸的是,这不是我的解决方案.有人有想法吗?

There are not many problem description like this. All I found was solved by updating to at least ruby 1.9.2. But that unfortunately is not the solution for me. Does somebody have an idea?

谢谢

  1. 下载此文件:https://github.com/hiranpeiris/therubyracer_for_windows/archive/大师.zip
  2. 将其解压缩到一个文件夹,然后 cd 到该文件夹​​.
  3. 通过gem install therubyracer*
  4. 在该文件夹中安装gem文件
  5. 该文件夹有 2 个 dll 文件.将它们复制到您的 ruby​​/bin 文件夹.
  6. 将此添加到您的 Gemfile:`gem 'therubyracer'
  7. 捆绑安装

玩得开心.