Installing ruby gem less-rails on windows machine using therubyracer - ruby

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

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

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.

Related

PHPStorm: Missing file for SCSS configuration?

I'm trying to switch over to PHPStorm and I would like to activate the transpiling of SCSS files, but it seems like one file is missing in my ruby-folder.
I found an image in this thread, which shows how to configure the file watcher:
The problem is now that I don't have a "scss.bat" in my /bin/-folder, to insert in the "Program:"-field. I made sure that I have the latest version of ruby by downloading it from rubyinstaller.org.
These ".bat"-files are in my folder:
erb
gem
irb
rake
rdoc
ri
setrbvars
testrb
I tried every file, but I get a different error each time.
What am I doing wrong?
Thanks for your help.
I found my error:
I forgot to install SCSS after my Ruby-installation. To do so open your commandline and type:
gem install scss

Trying to install foundation using compass

I get the following error when trying to get my project up on my mac.
LoadError on line 31 of /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb: no such file to load -- zurb-foundation
Note I have updated my gems, updated compass to the latest version, updated the foundation gem but I cannot get my stuff to compile. Also I tried creating a new project with the same settings but i get the same error.
What does your include look like? The library itself is just called foundation. On all my projects I include the path to my vendor files (usually bower_components) in my importPaths configuration, and include this in my main sass file:
#import 'foundation';

compass failing to load singularitygs gem

Trying to get a new project set up using Singularity.gs but I keep running into a snag with Compass.
First I used Terminal to install the necessary Ruby Gems (sass, compass, singularitygs, respectively).
Next I created a new project using the command:
compass create project1 -r singularitygs --using singularitygs
In the directory of my choosing.
At this point, in an effort to make life easier I've also attempted to use offerings like Scout (http://mhs.github.io/scout-app/) and/or Compass.app (http://compass.handlino.com/) so I can take advantage of a more user-friendly GUI.
I'm running into problems using either of these apps however, so I'm assuming it has something to do either with my Ruby gem install of singularitygs or with the creation of a new project.
Specifically, once I have a target directory and folder structure in place, I'll attempt to "watch" the sass folder and get an error that looks like:
(Compass)
no such file to load -- singularitygs
org/jruby/RubyKernel.java:1062:in `require'
file:/Applications/compass.app/Contents/Resources/Java/compass-app.jar!/require_patch.rb:6:in `require'
or
(Scout)
LoadError on line 1038 of org/jruby/RubyKernel.java: no such file to load -- singularitygs
/Applications/Scout.app/Contents/Resources/vendor/gems/gems/compass
0.12.2/lib/compass/configuration/data.rb:161:in `require'
Strangely enough, I also get a very similar error message in Scout if I try to watch a Sass folder inside of a project that's using Foundation (having also installed the zurb-foundation ruby gem previously)
I am SUPER new to getting Sass / Compass set up so I'm definitely feeling a bit out of my element. I know this is probably not the easiest thing to diagnose from my description, but I'm not sure what I'm doing wrong. Hopefully I've managed to describe my issue clearly enough. Bear with me if any of this appears vague or incomplete, definitely not my intention.
Thanks so much.
Apps like Scout and Compass.app come bundled with their own versions of Ruby so even though you installed the gems on your computer they are not installed when compiling from those apps.
Here is how to make Compass.app use the version of Ruby on your computer. Open preferences and check “Custom”. Note your path may be different:

issue using compass and zurb-foundation

Hi I have zurb foundation and I'm totally newbie. I'm using a ubuntu 12.04 ppc (g5) machine and I did the installation from the terminal, everything went ok, but when I try to create a project using compass and Zurb-foundation, this is what is going wrong?
LoadError on line 122 of /usr/lib/ruby/vendor_ruby/sass/../compass/configuration/data.rb: no such file to load -- zurb-foundation
Run with --trace to see the full backtrace
I did sudo gedit to see if this file data.rb exist and affirmatively it does exist...so since I'm a designer not savvy on ruby or compass...what it is wrong, shaving my head in shame...any help will be appreciated.
BTW I have googled and nothing.
You forgot to install Zurb Foundation. :)
Please execute the following command:
gem install zurb-foundation
This will install the Zurb Foundation extension for Compass.
After that, you can create your Foundation-powered Compass project.
Don't forget to study the documentation: http://foundation.zurb.com/docs/sass.html

Syntax error: File to import not found or unreadable: foundation/common/ratios

I have foundation installed and when I edit and save the app.scss file it creates a "app.css" and a "config.rb" file in the sass folder of my project. when I open that "app.css" file I get this
Syntax error: File to import not found or unreadable: foundation/common/ratios.
and then under that I get this:
File to import not found or unreadable: foundation/common/ratios.
Load paths:
/Applications/MAMP/htdocs/WebApp02/sass
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets
Compass::SpriteImporter
on line 1 of /Applications/MAMP/htdocs/WebApp02/sass/_settings.scss
from line 2 of /Applications/MAMP/htdocs/WebApp02/sass/app.scss
and then a bunch of paths to my gems.
It never created an app.css and config.rb file in my sass folder before I was wondering if anyone can explain why that is happening. Compass still complies to app.css in the "stylesheet" folder but I would like to fix this to keep from any future errors from happening.
config.rb file looks like this
require 'zurb-foundation'
Require any additional compass plugins here.
Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
You can select your preferred output style here (can be overridden via the command line):
output_style = :expanded or :nested or :compact or :compressed
To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
I was having same error in my project with sinatra. It was after upgrading from foundation 3.2.5 to version 4.0.2.
I realized that 'foundation/common/ratios' is not in the zurb-foundation gem anymore.
I had another error on "foundation not found or unreadable" so I had to modify also my Gemfile requiring 'compass' gem before zurb-foundation
gem 'compass'
gem 'zurb-foundation'
With foundation 3.2.5 'compass' wasn't explicitly required in Gemfile, but now it is and if you look at the zurb-foundation.rb code (in your ruby gemset), you can see:
if defined?(Compass)
Compass::Frameworks.register("foundation",
:stylesheets_directory => File.join(root,"scss"),
:templates_directory => File.join(root,"templates")
)
end
For this reason if in the project compass is not defined before zurb-foundation, zurb-foundation.rb doesn't expand the path including the scss folder.
I hope that my experience of today, may help you.
Best regards,
Roberto
I couldnt get this to work (rails 3.2.12 with asset pipeline and gem "compass-rails" and/or gem "compass") so I just locked onto 3.2.5
gem 'zurb-foundation', "= 3.2.5"
i had these same errors when trying to update a foundation 3 website using visual studio Express 2010. Express does not allow the use of the Mindscape extension tool.
so this is what worked for me a few times now. i basically start with a new webfolder using compass to create the folder. I don't waste my time trying to update because this seems to work for me. And its common to back up before a version update anyway.
from the root folder above your website. (i use the vs default path) so from the command line in rails i cd to this path
> cd C:\Users\georgegargoyle\Documents\Visual Studio 2010\WebSites\
*note if you are ungrading from foundation 3, and you only use ruby for foundation, you very well could have an old version of sass which the new foundation will need. i have not known it to hurt to just uninstall and reinstall sass
which is
> gem uninstall sass
>
> gem install sass
i think if it asks you the version of sass and you do not know
type the 5th option as text not the number 5 ... all versions ??
then.. type the number 5
you may get two warnings so i just hit y or yes twice.
anyway, from the websites folder type
compass create yournewfolder -r zurb-foundation --using foundation
you should see cool Woot! there it is then
> cd yournewfolder
to move into the project folder then
gem install compass
gem update compass
gem install foundation
gem update foundation
the documentation for foundation is below and i am new to this so this is not necessarily best practice, just what worked for me. Thanks to gekorob above I think i learned, which i suspected, that the order you run these commands matters because of the versions you have installed. ruby, compass, sass, foundation and visual studio.
Which i suspect can lead to problems if thinks get switched around . and would lead you here.
http://foundation.zurb.com/docs/sass.html
hope this helps and that you see lots of this.
http://www.ipaad.org/images/Step105.jpg

Resources