Friday, August 21, 2015

requirements_debian_update_system ruby-2.2.2 error

Today I got new laptop with Ubuntu 15.04 and I was trying to install ruby on rails with rvm.
I have successfully installed rvm and I can see that rvm is installed properly.
But when I have tried to install ruby within rvm using command 'rvm install 2.2.2' then I got below error.

Error:
sachinlenovo@sachinlenovo-g-5070:~$ rvm install 2.2.2
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/15.04/x86_64/ruby-2.2.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system...................
Error running 'requirements_debian_update_system ruby-2.2.2',
showing last 15 lines of /home/sachinlenovo/.rvm/log/1440068704_ruby-2.2.2/update_system.log
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
404 errors should be fixed for rvm to proceed. Check your sources configured in:
   /etc/apt/sources.list
   /etc/apt/sources.list.d/*.list
\n'
There has been error while updating 'apt-get', please give it some time and try again later.
404 errors should be fixed for rvm to proceed. Check your sources configured in:
   /etc/apt/sources.list
   /etc/apt/sources.list.d/*.list

++ return 100
Requirements installation failed with status: 100.

Then I found solution like this:

RVM will refuse to work, if apt-get update has any errors and it doesn't behave well. If your system's apt sources have an invalid repository than apt-get update gives you 404 or GPG error. This confused me for some time because this invalid or faulty repository has no connection with Ruby as well RVM. and after referring some documentation and solutions I came to know below scenario:

So for check the errors you have to run this command and need to find that which ppa is firing errors:
sudo apt-get update | grep "Failed"
then it will give you result like this:

W: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu vivid main  404  Not Found                                                                                      W: .......                                                         
E: Some index files failed to download. They have been ignored, or old ones used instead.

Then for resolve this error you have to press Windows key and need to search "Software & Updates" 

Then open it and go into Other Software there you can see some URLs which is failed while update.

Then uncheck that urls from this and close this window then you can do 
sudo apt-get update 
and then you can install ruby with
rvm install 2.2.2
Reactions:

17 comments:

  1. Thank you sir, you save my days.. :)

    ReplyDelete
  2. Visited lots of pages for this. But, couldn't find a solution for this.
    Thanks a lot for your great help sir... :))

    ReplyDelete
  3. How RVM manages installation of different versions of ruby...
    Can, u plz explai this...!!!

    ReplyDelete
    Replies
    1. Sorry for late response.

      RVM stands for Ruby Version Manager. So once we install ruby with any version that time RVM create separate directory for gems inside .rvm/gems folder. Where you can manage ruby version along with gemset. So with that we can manage gems as well.

      For more details, you can check this url: https://rvm.io/rvm/basics

      For more information as well, you can send me direct email as well.

      Delete
  4. Thanks that really helped :)

    ReplyDelete
  5. It helped me a lot, Sachin.
    Thanks for this help.

    ReplyDelete
  6. E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh > /dev/null; fi'
    E: Sub-process returned an error code
    am still getting this error

    ReplyDelete