Error: SASS installation for windows - ruby

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)

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

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.

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

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
Ref: https://github.com/rubygems/rubygems/issues/1736

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.
Here is a capture of my terminal

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>

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

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

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.

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:
Download from above (URL above)
Unpack/unzip into a directory and cd there (into the directory you unzipped it)
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.

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/

Related

Bundle install fails, Gem install succeeds

When trying to bundle install on a Gemfile that contained only the GitHub Pages gem and nothing else, on Ubuntu 18.04, I got error messages telling me to try installing eventmachine using gem install. That always succeeds, but bundle install still fails. How can I get bundler to see that the gem is installed?
I fixed this after many hours of struggle, by noticing that on the GitHub Pages repo there's a note that says
Important: Make sure you have Bundler > v1.14 by running gem update bundler in your terminal before following the next steps.
I have no idea why this mattered but I removed my ruby packages from Ubuntu and reinstalled them, then installed bundler with rubygems, which gave me a newer version:
sudo apt-get remove ruby
sudo apt-get install ruby ruby-dev
sudo gem install bundler
bundler --version
If anyone knows why I needed that version of bundler, or how I should have diagnosed this faster, I'd be interested to hear it. I'm not new to programming but I'm new to Ruby.
From my understanding it might be the gem you are trying to install requires a specific feature provided by bundler. If you check the change log of bundler there is some changes related to install github based gems on how to correctly read the user git settings. So I think that might be where the problem is from.

Certificate failure and Windows10 gem version 2.4.5.1

I'm new to much of this:
My problem begins at the rails new sample_app stage of the installrails.com process.
it does its thing, getting to run bundle install and errors with "Could not verify the SSL certificate for https://rubygems.org/."
I search and learn I must update certificates, as discussed here: http://guides.rubygems.org/ssl-certificate-update/
I learn at the above page that rubygems 2.4.x is broken for windows, and therefore no download exists to update my certificates.
So I try to update $ gem update --system 2.6.7 and this is what is returned:
Updating rubygems-update
ERROR: Error installing rubygems-update:
Unable to resolve dependency: user requested 'rubygems-update (= 2.6.7)'
ERROR: While executing gem ... (NoMethodError)
undefined method `version' for nil:NilClass
I keep trying to figure out how to do something so simple as uninstall my gem version 2.4.5.1 and install 2.6.7 but can't do it... my syntax?
I have also seen a workaround using these:
gem sources --remove https://rubygems.org/
gem sources -a http://rubygems.org/
But I don't understand how that helps with certificates or how it is a permanent solution! I removed the secure source, and cannot reobtain it because of the same certificate error. So now I am stuck with the http one. Thanks for your help!
Okay so I started fresh after posting the question.
I used the work around to bypass the certificate problem:
gem sources --remove https://rubygems.org/
gem sources -a http://rubygems.org/
This then allowed me to update my gem version.
gem update --system
Then I switched gem sources back:
gem sources --remove http://rubygems.org/
gem sources -a https://rubygems.org/
I ran into another problem when running rails new sample_app at the same place, bundle install. I found the fix here: Ruby on Rails cannot bundle install
my command was gem install bundler
then I was able to successfully create the sample app. Looking forward to the next problem!

How to avoid gem update error in windows?

showing below error
C:\Ruby21>gem update
Updating installed gems
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certif
icate verify failed (https://api.rubygems.org/specs.4.8.gz)
C:\Ruby21>
May be blocked by windows firewall.
Here's the fix to your problem.
I only had to follow these instructions.
Installing using update packages (NEW)
Now that RubyGems 1.8.x, 2.0.x, and 2.2.x have been released, you can manually
update to those versions.
First, download the proper version of RubyGems for your installation (e.g. if running version 1.8.28, download 1.8.30).
Note: To find the version of RubyGems you're using, run gem --version in the command line.
You can find download links at GitHub under
Releases.
Now, locate rubygems-update-X.Y.Z.gem where X.Y.Z will be the matching version of RubyGems that you need to update:
Running 1.8.x: download 1.8.30
Running 2.0.x: donwload 2.0.15
Running 2.2.x: download 2.2.3
Please download the file in a directory that you can later point to (e.g. the
root of your harddrive C:\)
Now, using your Command Prompt:
C:\>gem install --local
C:\rubygems-update-1.8.30.gem
C:\>update_rubygems --no-ri --no-rdoc
After this, gem --version should report the new update version.
You can now safely uninstall rubygems-update gem:
C:\>gem uninstall rubygems-update -x
Removing update_rubygems
Successfully uninstalled rubygems-update-2.2.3
After following these instructions, I was able to run gem update --system successfully.
I didn't have to implement the following set of instructions.
I think I was running gem version 2.4.4.

Cannot install Ruby Gems in Windows 7

I have successfully installed Ruby Gems on my Mac many times. I need to configure a Windows 7 Enterprise virtual machine with Compass, Sass and Suzy.
I downloaded an installed Ruby on the Windows machine with the installer, 1.9.3. I ran gem update --system which updated Rubygems to 1.8.4.
I was able to install Sass 3.2 by running gem install sass
However, if I run gem install compass or gem install susy I get an error:
Error while excecuting gem .. (ArgumentError) marshall data too short
Any ideas? At this point, I can't install those gems.
The alternative solution..: Download gem compass from here to your ruby root folder. Then try again
gem install compass
It should install this time..Good luck
Had same issue, updating rubygems system solved it. Just use the following command
gem update --system
For those finding this question, many great tips here. Using them, I found this solution to work:
At the N: prompt in "start command line with ruby environment", I used the command rmdir /S .gem which deleted all gems. I then installed them again with gem install as directed on their respective host web pages. Hope this helps someone.

Can't install JSON gem

I need to install json because I get this error:
Could not find json-1.4.6 in any of the sources
I ran gem install json and bundle install but I was only able to install json-1.5.1 when I need json-1.4.6
I have gem 'json', '1.4.6' in my gemfile, so I'm not sure what's going on...
UPDATE
I get this error:
Installing json (1.4.6) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1216:in `chmod': Operation not permitted - /Library/Ruby/Gems/1.8/gems/json-1.4.6/CHANGES (Errno::EPERM)
After checking logs by running $ heroku logs
I found "An error occurred while installing json (1.4.6), and Bundler cannot continue.
Make sure that gem install json -v '1.4.6' succeeds before bundling."
I then removed 2 json entries from the Gemfile.lock and had no further issues.
Why did you run gem install json at all? Bundler takes care of that for you and will ensure that the correct version of each gem is installed (since sometimes dependencies require an older version). Run
gem uninstall json
bundle install
Also ensure you have source 'https://rubygems.org' at the top of your Gemfile.
As for the permissions info, you may have to run gem and bundle commands with sudo.
By the way, I highly recommend taking a look at and using RVM, particularly the gemsets feature. It will make your life infinitely better when developing Ruby apps. If you decide to do so, I'd also suggest trashing all the gems you've install using the system Ruby by running sudo rm -rf /Library/Ruby/Gems/1.8/. It's also important that when using RVM you don't have to use sudo when running gem (or bundle), which is not only safer but less typing too.
Please update your rubygems by executing the following command..
gem update --system
may be it will solve the problem. After updating your gem. Then run the following command to install json
gem install json
Now you can get json gem installed in your system.
Try:
$ sudo apt-get install ruby1.8-dev
If you're using rbenv, try rbenv rehash
I had this problem when trying to build a website with Jekyll.
Turned out I hadn't followed all the instructions at https://jekyllrb.com/docs/installation/ubuntu/
I don't know if it was the missing packages or commands into ~/.bashrc but it fixed the problem in two instances of Ubuntu in WSL
Remove the json entries from the Gemfile.lock file and try to re run bundle install..

Resources