Error: SASS installation for windows

2019-01-13 05:24发布

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 gem sass
11条回答
smile是对你的礼貌
2楼-- · 2019-01-13 05:47

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.

查看更多
Bombasti
3楼-- · 2019-01-13 05:48

The first step to Rubygems(http://rubygems.org/) then download sass on(http://rubygems.org/gems/sass) put in: npm install

查看更多
男人必须洒脱
4楼-- · 2019-01-13 05:50

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

查看更多
淡お忘
5楼-- · 2019-01-13 05:50

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:

  1. gem sources -a http://rubygems.org/
  2. gem install sass

Adding http://rubygems.org/ to sources solves this.

Here is a capture of my terminal

查看更多
倾城 Initia
6楼-- · 2019-01-13 05:55

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/

查看更多
手持菜刀,她持情操
7楼-- · 2019-01-13 05:59

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>
查看更多
登录 后发表回答