Error: SASS installation for windows
RubyGemSassRuby Problem Overview
am trying to install sass after installing ruby, but iam getting following error, please help me to fix this
maradhak@WW730VW7X1688 /c/softwares
$ gem -v
2.2.2
maradhak@WW730VW7X1688 /c/softwares
$ gem install sass
ERROR: Could not find a valid gem 'sass' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://rubygems.org/latest_specs.4.8.gz)
Ruby Solutions
Solution 1 - Ruby
The error has something to do with being vulnerable to the Poodle SSL bug, it will not be verified for that reason. If there's a way to upgrade to a better certificate, but at the time of writing this answer, I could not find the upgraded certificate.
I used the non-SSL host instead, altough I should note that this is not the best nor a permanent solution, it lacks security.
The command used:
gem source -a http://rubygems.org/
A discussion about this subject can be found here: https://github.com/rubygems/rubygems/issues/515#issuecomment-65326585
Update: There seems to be a permanent solution now, which replaces the certificate with a proper protected one. It can be found on the following URL, an tutorial is included in that page. https://gist.github.com/luislavena/f064211759ee0f806c88#installing-using-update-packages-new
Solution 2 - Ruby
Short answer:
gem sources -a http://rubygems.org/
Confirm than you don't really care about that specific warning, since you trust rubygems.org. Then:
gem install sass
And it works.
Solution 3 - Ruby
thanks for your suggestions, as you guys said this seems to be SSH update issue.
have solved this issue simply down graded my RUBY version from "2.1.5" to "1.8", and the gem version is "1.8.29".
then i was able to install SASS
Solution 4 - Ruby
Following worked for me:
Remove the https source temporary, run gem update --system and then switch back to https.
gem sources --remove https://rubygems.org/
gem sources --add http://rubygems.org
gem update --system
gem sources --remove http://rubygems.org
gem sources --add https://rubygems.org
Solution 5 - Ruby
I also encountered the same problem today。
Running gem install sass
returned
ERROR: Could not find a valid gem 'sass' (>= 0), here is why:Unable to download data from https://rubygems.org/ -SSL_connect returned=1 errno=0 state=SSLv3read server certificate B: certificate verify failed(https://api.rubygems.org/specs.4.8.gz)
Then I find a way to fix it:
gem sources -a http://rubygems.org/
gem install sass
Adding http://rubygems.org/ to sources solves this.
Solution 6 - Ruby
For me it was a proxy issue. When I appended the proxy details to the gem install command it worked.
gem install sass --http-proxy=http://<yourproxy>:<port>
Solution 7 - Ruby
The first step to Rubygems(http://rubygems.org/) then download sass on(http://rubygems.org/gems/sass)
put in: npm install
Solution 8 - Ruby
You don't need to disable SSH or downgrade your ruby version, you can simply install the SASS gem manually. Here's how to do it:
- On windows, first install the Ruby installer for windows.
- Download the latest version of the gem from here:
https://rubygems.org/gems/sass Click the latest version, and then on
the right side of the screen (in Links section) click the "Download"
link to download the original gem file (
sass-*.*.*.gem
) - Now paste the downloaded gem file to the directory that ruby is
installed on:
C:\Ruby22-x64\bin\sass-*.*.*.gem
- In Command Prompt run the following commands:
cd C:Ruby22-x64/bin
gem install sass-*.*.*.gem1
NOTE: You may also need to call the local flag while installing the gem: gem install --local C:Ruby22-x64/bin/sass-*.*.*.gem
Solution 9 - Ruby
Install a full fledged Cygwin on your windows, the ssh support is good in it. You should be able to install it without any extra efforts, well I always do. In fact once you have Cygwin install you would hardly use the command prompt.
Solution 10 - Ruby
I'm totally new to Ruby and Sass. I didn't want to risk security and I'm on a Windows machine. I had already installed latest ruby, but kept getting the same error message as the OP when trying to run gem install sass
at the command prompt.
Here's what solved the problem for me.
Go to: https://rubygems.org/pages/download and follow the instructions on the page starting here (for manual installation):
> If you don't have any RubyGems installed, there is still the pre-gem approach to getting software, doing it manually:
>
> 1. Download from above (URL above)
> 2. Unpack/unzip into a directory and cd
there (into the directory you unzipped it)
> 3. Install with: ruby setup.rb
(at the command line type that command. You may need admin/root privilege)
After I installed ruby gems, I opened Ruby command prompt (using Start Command Prompt with Ruby from the start menu) and ran the command gem install sass
and it worked:
C:\Users\chris>gem install sass
Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Parsing documentation for sass-3.4.22
Installing ri documentation for sass-3.4.22
Done installing documentation for sass after 36 seconds
1 gem installed
Wanted to detail it as much as possible for other newbies like me. Hope this helps someone.
Solution 11 - Ruby
Changing from http to https makes your computer vulnerable to hackers
I explain some solutions in my answer here: https://stackoverflow.com/a/40075753/845413
If you found this error by searching and are using RVM on OSX just run.
rvm osx-ssl-certs update all
Bundler outlines a few other solutions in their troubleshooting guide for this error: http://bundler.io/v1.16/guides/rubygems_tls_ssl_troubleshooting_guide.html#troubleshooting-certificate-errors
and include...
gem install bundler
gem update --system
Finally, you can simply reinstall RVM or rubygems manually.
Manually install Ruby gems: https://rubygems.org/pages/download
Manually install RVM (recommended): http://rvm.io/