How to install Compass on Windows - compass-sass

I have installed Ruby on my system, and now I want to install Compass. But when I execute the gem install compass command, it shows an error like this:
could not find valid gem 'compass' <>=0> in any repositary
And also:
SocketError: getadressinfo: no such host is known.<http://rubygems.org/latest_specs.4.8.gz>
I don't know what the problem is. If I run ruby -v, it shows the Ruby version. So what's the problem with installing Compass?
Can anyone explain this to me properly? I've searched Google, but all I could find was some proxy problem - and I couldn't understand how to set the proxy at all.
I'm using Windows and a company internet connection, so I don't know the username and password of my proxy.

I was behind a proxy and HumberFrench's solution above helped:
Go to Ruby bin folder:
cd c:/Ruby193/bin
And then install compass gem:
gem install compass --http-proxy http://<proxy_adreess>:<port_of_proxy>
Another tip: am on Aptana Studio, so this could be run from within Aptana's terminal.
Cant up-vote so adding this here.

I had the same problem, finally solved it manually.
Goto the rubygems compass page, and download the gem by clicking the Download link. Scroll down and you will see three Runtime Dependencies. Goto each of them and download those gems also. Put all of them in a directory, and try
gem install downloaded_compass_filename
This should solve your problem.
If it gives an repository not found error message, you can force gem to try local files through the gem --local install option

if you use a proxy, and get error, do it
gem install compass --http-proxy http://<proxy_adreess>:<port_of_proxy>
gem install -h gives you a lor of options

The proxy is the most likely cause. You will have to get permission from the network admin, or manually download compass. For more info, See this SA post.
If you decide to go the manual route here is a link to the RubyGems compass page. This not ideal, but also better than having to write css without compass magic ^^
Good luck!

On windows i had a few instalations of ruby:
C:\ruby187
and
C:\Ruby200-x64
install compass in both places, using:
gem install compass

Try running the install command in the bin folder.
$ cd C:\Your_Ruby_Folder\bin
$ gem install compass

I have same problem and i resolve it with.
Uninstall ruby end deleted folder ruby
Download ruby version 1.9.x
After thet install sass
last stem: install compass

Related

Ruby-Rubocop not working on vscode

/Users/me/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in ``find_spec_for_exe': can't find gem rubocop (>= 0.a) with executable rubocop (Gem::GemNotFoundException) from /Users/me/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in ``activate_bin_path' from /Users/me/.rbenv/versions/2.5.1/bin/rubocop:23:in'
This is the error I keep getting whenever I type something. Does anyone know how to fix this problem?
After many agonising hours and reading other solutions I finally deduce that the answer was in installing Rubocop from the root. Below steps worked when I tried.
You first need to go the root in your terminal.
Install Rubocop then find the path and add it to the execute path in Rubocop settings
$ cd ~
$ gem install rubocop
$ which rubocop
Paste location given in Ruby-Rubocop configuration settings > Execute Path
/Users/username/.rvm/gems/ruby-2.6.1/bin/
I can propose you 2 solutions because I had experienced the same problem:
For me installing the bundler with sudo -> sudo gem install bundler fix the issue.
Also it can be a mistake coming from you RubyGems version. It seems like ruby -v2.5 has a compatible problem with RubyGems -v2.7.3. So try upgrading the RubyGems to -v2.7.4 using the gem update --system command.
For anyone who downloaded Ruby26-x64 and is having the same issue. It is probably because of the install locations and that your C://Users//you//whatever doesn't exist. To fix this I simply checked where ruby was installed on my C drive. For me, it downloaded by default into a file called Ruby26-x64 on my C drive. Open the folder go to bin and double check that there is a rubocop.bat somewhere. Copy paste the path, into settings.json. Should look something like this.
"ruby.rubocop.executePath": "C:\\Ruby26-x64\\bin\\",
Note that this is a solution I found on Windows 10, I don't know about Mac.
EDIT:
Settings.json can be found by going to File>Preferences>Settings>Workbench
and under "Editor Associations", you will see a button that says Edit in settings.json, there are many ways to open your settings.json file, this is just one.
After installing rubocop gem gem install rubocop
Run bundle install and then run rubcop again. It functioned for me.

Error installing SASS gem - don't have permissions

I'm not well versed in terminal, but I'll try my best to make this as clear and concise as I can.
I'm trying to install SASS and get the following errors:
When using gem install sass I get .
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
When using sudo gem install sass I get .
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
I have Xcode installed and I have agreed to the terms.
I even tried updating my Ruby, but terminal tells me I already have the most updated version.
ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
The worst part of all of this is that when I navigate to my Ruby/Gems/2.3.0/gems directory, there is a sass-3.5.5 folder!!! (linked image to follow)
Ruby directory path to sass folder
I try running sass -v and get -bash: sass: command not found
I feel like I've tried everything that I can think of or find online. I'm at a loss and definitely need some help.
The issue can be fixed by installing RVM or Rbenv for managing ruby versions and gems.
Also, FilePermissionError can be fixed using the -n parameter
sudo gem install sass -n /usr/bin
I prefer not touching sudo command, so I managed to solve this issue by referring to SASS home page:
If you use Node.js, you can also install Sass using npm by running
npm install -g sass
If you find it helpful, kindly upvote or leave comment so that I know it can solve your issues too.
Or one could update the directory for where gems are installed.
Please see the origional answer here: https://stackoverflow.com/a/2619731/3302764
export GEM_HOME=~/.gem
export GEM_PATH=~/.gem

Can Ruby's Sass gem be manually installed?

I work inside a corporate firewall. I am using Windows 10 and have the Ruby 2.4 x64 install.
I need to get the sass gem. I cannot do it through the command line because all external calls such as this are blocked and will not be unblocked for my situation. Is there a place I can manually download the sass gem, and then issue the command to install the gem from a local file?
I'm in the same position and use two techniques
through the firewall
See my answer at installing-gems-from-behind-a-corporate-firewall
from a local file
You download the gem from https://rubygems.org/downloads/sass-3.5.4.gem
You can put the file in your ruby\bin folder and delete it later.
Then you cd to your bin folder and install it in the console with the command
gem install sass-3.5.4.gem --local
the 3.5.4 is the current version.
If there are dependencies (other gems) you need to first download them as wel.
Can't see what these are because on this machine I'm still using Ruby MRI 1.9.3 and the current version of sass requires Ruby 2.0.0
See also my answer here
deploy-a-ruby-gem-local-without-using-git-or-internet-access

Error when using overcommit and Github Desktop

I am using overcommit gem (https://github.com/brigade/overcommit) in my project, when I use Github Desktop for osx I get these errors:
This repository contains hooks installed by Overcommit, but the
overcommit gem is not installed. Install it with gem install
overcommit. (1)
The gem is installed, it works in terminal. I guess it's because I use rvm and Github Desktop doesn't know about rvm. Anybody knows how to fix this?
Ok finally got it to work!
Combined the answer from #michelegera with comment from #rewritten
Step 1:
sudo su -
gem install bundler
gem install overcommit
gem install rubocop
Step 2: added command: ['bundle', 'exec', 'rubocop'] to .overcommit.yml
Thanks for the help!
Most likely it's this line where the error occurs. As you can see the main issue is that it's not able to require 'overcommit'. I don't know the GitHub desktop client so well (maybe there is a way to configure it inside of it), but one thing you could do is adding the absolute path where rvm stores your gems to the "require path" in the hook file. This could look like:
$: << "/home/user/.rvm/path/to/gems/dir"
The disadvantage of this is that you would have your absolute path in the hook file and it most likely won't work for others. You might also want to consider installing the gem globally for the the ruby interpreter that executes the script (see Shebang line in the hook file).
You are right, Github Desktop (or any other GUI) isn’t running in your terminal environment, so it knows nothing about your specific RVM installation.
A simple solution is to install overcommit and any other gems required by your hooks into your system Ruby:
sudo su -
gem install bundler
gem install overcommit
gem install rubocop
...
If you installed Git via Homebrew or other means, you might have to change the Git binary used by your GUI.
For example, in Tower, I selected Homebrew’s version rather than the System’s.

ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format

I am developing a Sencha touch 2 application. I have been following the "Styling the user interface of a Sencha Touch application" tutorial on theming of secha touch applications.
It requires me to install Ruby, Compass and SASS.
I installed Ruby using the installer from rubyinstaller.org.
On executing the following command, I get the expected result which confirms correct installation:
C:\>ruby -v
ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
Current source is up to date:
C:\>gem sources
** CURRENT SOURCES **
http://rubygems.org/
Next, since I am behind a proxy, I used the following command to install HAML/Compass:
C:\>gem install -p [proxy:port] compass
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format**
Can someone help me? I found solutions such as system update, gem sources update, but everything is up to date on my system.
Edit:
C:\>gem install compass
works perfectly fine on my private system. When I try the same command from my workplace I need to use the proxy as mentioned above and that results in an error.
I assume the ERROR occurs since the web sense at my workplace blocks these downloads.
Solution: I downloaded the required gems: chunky_png, fssm, compass, sass, haml etc.. directly from http://rubygems.org/gems and placed these gems in my local directory.
After this I tried gem install compass. This first searches your local directory. On finding the required gems, installation takes place. Does not require connection to the ruby website.
Note: Run the command from the path where the gems are located
eg: I have placed the gems in C:\Ruby193\lib\ruby\gems\1.9.1\gems
So I run the following command :
C:\Ruby193\lib\ruby\gems\1.9.1\gems>gem install compass
I had a similar problem, it worked on my own private laptop, but failed while using a virtual server at work (running Ubuntu 12.10) that used a proxy.
Following the suggestion I found here, from the command line I defined:
export HTTPS_PROXY=proxy-address:proxy-port-number
export HTTP_PROXY=proxy-address:proxy-port-number
and then my gem install package worked fine.

Resources