Trying to get Sass and Bundler to work cross team? - ruby

I created a project that is working and compiling sass as expected. My setup is just using sass, compass, & susy with Netbeans. I had another team member pull it from source control and he is unable to compile with the error:
Syntax error: File to import not found or unreadable: susy.
Load paths:
C:/wamp/www/77864nl2014/wp-content/themes/nl (DEPRECATED)
C:/wamp/www/77864nl2014/wp-content/themes/nl/sass
C:/Program Files (x86)/Prepros/gems/gems/bourbon-3.1.8/app/assets/stylesheets
C:/Program Files (x86)/Prepros/gems/gems/neat-1.4.0/app/assets/stylesheets
C:/wamp/www/77864nl2014/wp-content/themes/nl/sass
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-core-1.0.0.alpha.19/stylesheets
Compass::SpriteImporter
on line 2 of C:\wamp\www\77864nl2014\wp-content\themes\nl\sass\main.scss
Use --trace for backtrace.
He is using prepros and has a watch setup on the projects sass directory. He says that prepros is setup with the compass option and configured to use ruby. He has also already installed bundler.
The project config.rb looks like this:
http_path = '/'
css_dir = '/wp-content/themes/nl/styles'
sass_dir = '/wp-content/themes/nl/sass'
images_dir = '/wp-content/themes/nl/images'
javascripts_dir = '/wp-content/themes/nl/scripts'
require 'bundler/setup'
require 'susy'
The Gemfile looks like:
source 'https://rubygems.org'
gem 'sass', '3.3.4'
gem 'compass','1.0.0.alpha.19'
gem 'susy','1.0.9'
I'm not sure what's going on exactly but have several things to try, but hope asking here could expedite the process. We have numerous developers in my office using PCs and Macs, with various IDEs and I was hoping bundler could help solve some issues we have been having. I want to be able to set the specific gems and versions used for a project and commit that with the rest of the project in source control. If another developer needs to work on that project I was hoping bundler would use or pull down the proper gems for the project and the developer would be off and running without having to update configs, gems, etc. Is this how bundler can work once we figure this out? If not is there another better solution for our situation and goals?

The key was to prepend your "compass watch" with "bundle exec". So in command prompt, start your watch using "bundle exec compass watch" on the project directory.

Related

File to import not found or unreadable when using Rails asset gem

I'm trying to create a rails asset gem whose source is here. The problem is that when I use the gem in try to require or import the asset files in my Rails 4 project, I get the error:
File to import not found or unreadable: jquery.xdan.datetimepicker
I've inspected the paths it is looking through, and it looks like it's not actually looking in the assets directory for my gem (the gem folder isn't anywhere in the list). So, it seems like the gem isn't getting required, since if it was, the Engine would be getting loaded, indicating to Rails that I have an assets folder somewhere. Can anyone see what I'm missing? From what I can tell, I'm doing everything that other asset gems are doing.
I looked at your Gem. In order to get it working, rename lib/xdan_datetimepicker_rails.rb to lib/xdan-datetimepicker-rails.rb.
In your Rails project, uninstall your old gem and install the new one. To make sure it's installed properly:
$ rails c
> pp MyRailsApp::Application.assets.paths
You should see an array of paths that are in the asset pipeline. Look for:
/gem/path/to/xdan-datetimepicker-rails-0.0.1/app/assets/javascripts
/gem/path/to/xdan-datetimepicker-rails-0.0.1/app/assets/stylesheets
NOTE: Restart rails c and/or rails s if you're not seeing it.
Finally, in order to use the assets:
app/assets/javascript/application.js
//= require jquery.xdan.datetimepicker
app/assets/stylesheets/stylesheet.css.scss
*= require jquery.xdan.datetimepicker

Installing the correct environment for Angular with Compass and all other Node dependencies

I am just trying to make a local development environment that isn't on my work computer, and I keep getting an error:
Warning: Errno::ENOENT on line 441 of /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb: No such file or directory - /Users/johnpett/Desktop/Node/app/bower_components
Run with --trace to see the full backtrace Use --force to continue.
I have installed all the Ruby parts and Yeoman to build the app scaffold, but I can't seem to run the 'grunt server' command without throwing up this error.
The error is quite clear, a grunt-plugin require that file...
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb
Anyway ruby components are needed usually if you plan to use compass, if not, you can comment the "compass" sub-task in the "server" task in Gruntfile.js
Your folder was surely not called bower_components at that time. I guess you used yeoman.
In your compass task config you should have modified bower_components.

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:

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

oocss-compass plugin setup

I'm having trouble in the setup of oocss-compass plugin.
The steps I did:
Downloaded the oocss-compass and placed it on my desktop (https://github.com/he8us/oocss-compass)
Inside the oocss-compass destkop folder I runed:
rvm use #global
gem build oocss-compass.gemspec
gem install oocss-compass-[GEMVERSION].gem
The gem is on my gem list (oocss-compass)
Then on my working folder (not RoR project, just empty folders and html static pages), I runed:
compass create css -r oocss-compass --using oocss-compass
And it returns me an error:
Errno::ENOENT on line ["95"] of /Users/username/.rvm/gems/ruby-1.9.2-p290#global/gems/compass-0.11.7/lib/compass/installers/base.rb: No such file or directory - /Users/username/.rvm/gems/ruby-1.9.2-p290#global/gems/oocss-compass-0.0.1/lib/../templates/project/partials/_base.sass
What can be missing or what i did wrong on the installation?
I've just submitted the modifications to GitHub and published a gem on Rubygems.org ;)
You can update the gem and start building...
Have a nice day,
He8us
I'm the owner of the repository.
I've just did the test and I have the same problem. It's probably because Compass changed the way to create the plugins. I will look at it and come back to you asap.

Resources