Installing ruby gem less-rails on windows machine using therubyracer

我怕爱的太早我们不能终老 提交于 2019-11-29 15:43:45

问题


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

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

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

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

My css.file is alomst empty

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

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

I am using the rails installer with ruby 1.9.3.

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?

Thanks


回答1:


  1. Download this file: https://github.com/hiranpeiris/therubyracer_for_windows/archive/master.zip
  2. Extract it to a folder and cd to that folder.
  3. Install the gem file in that folder by gem install therubyracer*
  4. The folder has 2 dll files. Copy them to your ruby/bin folder.
  5. Add this to your Gemfile: `gem 'therubyracer'
  6. bundle install

Have fun.




回答2:


After a lot of research and trial and error it seems that less is not working on the windows plattform at the moment.

So my solution is to use the bootstrap-sass-rails gem instead. This is working pretty well.



来源:https://stackoverflow.com/questions/13265504/installing-ruby-gem-less-rails-on-windows-machine-using-therubyracer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!