How to install ruby on Debian6 - ruby

after following the install instruction here on my Debian system
sudo apt-get install ruby1.9.1
I still get the error
root#MyDebianVPS:/usr/local# ruby
bash: ruby: command not found
should I restart my system to make it work or I miss something?
$ su root
Password:
root#MyDebianVPS:/home/yozloy# sudo apt-get install ruby1.9.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
ruby1.9.1 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.
root#MyDebianVPS:/home/yozloy# ruby -v
bash: ruby: command not found
root#MyDebianVPS:/home/yozloy#

You are going to want to look to see if that is what the Debian package is actually called.
Try this:
sudo apt-get install ruby1.9
If that completes, awesome. Then try:
ruby -v
And report back what you have.

try ruby1.9 ... they may not have symlinked the command to ruby.

Related

Installation error when installing Ruby for Jekyll

I'm running on Windows 10 Enterprise, build 1703. I have Anaconda 4.4.0 and Python 3.6 installed. I'm running bash and Ubuntu Linux was installed o.k.
I'm trying to install Ruby for Jekyll (https://jekyllrb.com/docs/windows/#installing-jekyll).
The install command is:
sudo apt-get install ruby2.3 ruby2.3-dev build-essential
and it gives the error:
root#bigsur:/mnt/c/Windows/System32# sudo apt-get install ruby2.3 ruby2.3-dev build-essential
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
root#bigsur:/mnt/c/Windows/System32#
root#bigsur:/mnt/c/Windows/System32#
root#bigsur:/mnt/c/Windows/System32# sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of python3.5:
python3.5 depends on python3.5-minimal (= 3.5.2-2ubuntu0~16.04.3); however:
Version of python3.5-minimal on system is 3.5.2-2ubuntu0~16.04.1.
python3.5 depends on libpython3.5-stdlib (= 3.5.2-2ubuntu0~16.04.3); however:
Package libpython3.5-stdlib:amd64 is not installed.
dpkg: error processing package python3.5 (--configure):
dependency problems - leaving unconfigured
Setting up libapt-inst2.0:amd64 (1.2.24) ...
dpkg: unrecoverable fatal error, aborting:
unable to truncate for updated status of 'libapt-inst2.0:amd64': Invalid argument
root#bigsur:/mnt/c/Windows/System32#
Any help will be greatly appreciated.
Charles
I read many posts on the Internet that said the best way to install Jekyll was to install by way of a linux subsystem. I now realize that this is bad advice. After running into trouble (see above), I started over. I found that Build 1703 of Windows 10 Enterprise already had the infrastructure to install Jekyll with the instructions at: https://jekyllrb.com/docs/installation/. I followed these instructions and I now have a clean installation of Jekyll. Don't bother installing Ubuntu. You don't need it, and you will save over 700 MBytes of disc space.
Charles

Ruby RVM apt-get update error

I get following error when trying to install anything with RVM:
Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/ubuntu/13.04/x86_64/ruby-2.1.1.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..kshitiz password required for 'apt-get --quiet --yes update':
............................
Error running 'requirements_debian_update_system ruby-2.1.1',
showing last 15 lines of /home/kshitiz/.rvm/log/1400047196_ruby-2.1.1/update_system.log
++ /scripts/functions/logging : rvm_pretty_print() 78 > case "${TERM:-dumb}" in
++ /scripts/functions/logging : rvm_pretty_print() 81 > case "$1" in
++ /scripts/functions/logging : rvm_pretty_print() 83 > [[ -t 2 ]]
++ /scripts/functions/logging : rvm_pretty_print() 83 > return 1
++ /scripts/functions/logging : rvm_error() 117 > printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
For 404 errors 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.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
++ /scripts/functions/requirements/ubuntu : requirements_debian_update_system() 53 > return 100
Requirements installation failed with status: 100.
How can I fix this?
RVM doesn't behave well if apt-get update has errors. If your apt sources have an invalid repository that gives 404 or GPG error, RVM will refuse to work. This can be confusing because it happens even if the faulty repository has nothing to do with ruby or RVM.
The following fix worked for me (Ubuntu):
Run apt-get update and see if there are any errors. Edit your sources.list and precise.list in /etc/apt to remove the faulty repositories. Repeat until apt-get update succeeds without any errors. Then try running RVM.
You can try to skip the rvm updating system so apt-get won't be called.
# Disable RVM from trying to install necessary software via apt-get
rvm autolibs disable
# Then try installing Ruby:
rvm install 2.4.0
See https://stackoverflow.com/a/16759839/1212791
I also had to remove failing repositories but I had hard time spotting them and removing them based on instructions here. So I found this link which explains exactly why this happens and how to remove failing repositories:
In short, run following to find failing repositories:
sudo apt-get update | grep "Failed"
An example output can be like this:
:~# apt-get update | grep "Failed"
W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
And finally use this command to remove the failing repo(s):
sudo add-apt-repository --remove ppa:{failing ppa}
for the example here it will look like this:
sudo add-apt-repository --remove ppa:upubuntu-com/web
Alternative, it is also possible to cut the crap in rvm. I edited requirements_debian_update_system() in file /usr/share/rvm/scripts/functions/requirements/ubuntu like this:
requirements_debian_update_system()
{
echo "*fake* apt-get update"
# __rvm_try_sudo apt-get --quiet --yes update ||
# {
# typeset __ret=$?
# case ${__ret} in
# (100)
# rvm_error "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
#"
# ;;
# esac
# return ${__ret}
# }
}
This happened to me as well when I was trying to install a version of Ruby as a non-sudoer user. However, when I logged in as my admin user (with sudo privileges) and ran sudo apt-get update | grep "Failed" I would get no errors and, yet, rvm install x.x.x would still result in asking for a password (when I ran rvm install as the non-sudoer user.)
I was banging my head with this for a while because I didn't want my rvm (regular user) user to have sudo privileges. Then after some putzing around on Google I figured out that I could log in as my admin user.
Go through the steps of installing RVM for that user (as per their documentation):
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ \curl -sSL https://get.rvm.io | bash -s stable
$ source ~/.rvm/scripts/rvm
Then (as the admin user) jump straight into installing the RVM required packages:
$ rvm requirements
at which point it asks for my sudo password and installs the required apt packages for the entire system after I enter my password.
Then I log off from server as admin user and log back in as rvm user (with no sudo privileges) and try to install a version of Ruby.
$ rvm install x.x.x
and now it works.
You don't need of apt-get to install rvm and to use it !
Just curl (apt-get install curl)
Launch \curl -sSL https://get.rvm.io | bash -s stable --ruby
and rvm install 2.1.1 or another ruby's version and it works ;)
gem update etc...
RVM will be independent of apt-get so you'll have no longer issu.
For more informations : https://rvm.io/rvm/install
I had the same issue. If none of the other answers work try this. I ran the following command to fix it:
sudo apt-get -f install
Then I remembered that I failed installing a package earlier that day. What this command did was resolve the dependencies on that package and allowed RVM to do its thing.
I just tried
sudo apt-get update and found some of them are failing; for example..
Err http://extras.ubuntu.com raring/main Sources
404 Not Found
I went ahead and deleted those items from the list here..
sudo gedit /etc/apt/sources.list
It worked!
I was getting an error similar to this while running curl -sSL https://get.rvm.io | bash -s stable --ruby. It took a while but I finally realised that I had synaptic open: the installer couldn't run because apt was locked
I was also getting this error when my working directory was inside a mounted dir.
The fix was just to:
cd ~
I figured this out by seeing this at the bottom of a sudo apt-get update
E: Unable to change to /path/to/my/current/directory/ - chdir (13: Permission denied)
I got the same error.I tried most of above answers but none works for me, so i just change server
Goto directory etc/apt
click on Sources.list
Change the server to us or some else server
Reload (it will update your cache from that server)
Then run sudo apt-get update
this problem caused in apt-get update so you have to disable the PPA :
System Settings>Software & Updates>Other Software
then reinstall.
In my case rvm missed some linux packages, which couldnt be installed without sudo. There were no apt-get install errors at all.
When running rvm install ruby x.x.x with sudo, rvm installed packages required to build ruby and it worked.
Issue - requirements_debian_update_system ruby-2.2.2 error
I also had the same issue. I found info on this link
Click Here
I followed this and resolved my issue. Was able to install ruby as
rvm install 2.2
1) Before installing ruby must be done update:
apt is preferred over apt-get for interactive use in recent Ubuntu versions and apt should fix by:
sudo apt update
sudo apt upgrade
Or with apt-get may be used --allow-releaseinfo-change
sudo apt-get --allow-releaseinfo-change update
2) After successfully installation, for example ruby-2.3.1:
rvm install 2.3.1
apt install libc6:amd64 libc6:amd64 libc6 libc6-dev:amd64 libc6-dev libc-dev-bin libc-bin man-db libc-dev-bin libc6-dev:amd64
thats work fine for me ^^
The problem is with your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
So to 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 to resolve this error you have to press the 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 those URLs from this and close this window and then do
sudo apt-get update
Finally, you can install ruby with
rvm install 2.4
PS: You can change the version you want to install ruby.

Error while installing ruby using rvm

Am getting the below error while trying to install ruby using rvm:
$rvm install 1.9.3
Searching for binary rubies, this might take some time.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..................................................................................................
Error running 'requirements_debian_update_system ruby-1.9.3-p448',
please read /home/troy/.rvm/log/1379872584_ruby-1.9.3-p448/update_system.log
Requirements installation failed with status: 100.
Can you help me on this!
Remove broken or 404 repos from your /etc/apt/sources.list.
rvm will fail if you don't remove or comment them out.
To work out which aren't working, run apt-get update and see which ones are marked as failing.
Once you are using rvm, installing Ruby is easy.
rvm install ruby
rvm use ruby --default
I had the same problem.
It isn't unusual to not have a binary package for you distribution, and rvm should try to install from source.
First, check that it didn't actually install it:
rvm list
Otherwise, I suspect you may be missing some depedencies, which you can find with:
rvm requirements
You'll need to install those and the run the install again.
make sure you can update your system:
sudo apt-get update
and then start rvm installation again.
Update 1:
also it looks like you are using old version of rvm, make sure to update rvm before continuing:
rvm get stable
been having a similar problem and discovered a typo in grizzly.list file
http://ubuntu-cloud.archive.cononical.com precise-updates/grizzly
should have been
http://ubuntu-cloud.archive.canonical.com precise-updates/grizzly
i.e. first a in canonical
is this mistake part of the ubuntu 12.04 distribution?
Make sure when you run sudo apt-get update, all your PPAs are updating correctly. If not, remove them or edit them so they do so (you might need to change the distribution, for example, from raring to lucid. You can do this through terminal or Software Center. This and this should help)
When you are initially installing rvm, read the notes. For suppose you get notes like,
create a * WARNING: You have '~/.profile' file, you might want to load it,
to do that add the following line to '/home/name/.bash_profile':source ~/.profile
Then-> $ sudo gedit /home/name/.bash_profile
Add line `~/.profile` to the file. Save and close it.
now run $ rvm requirements
You should get a success message.
RVM will not install ruby if apt-get is failing. I had the same issue and noticed when running apt-get update, it was failing on "google-chrome.list". I fixed it following these directions and was then able to successfully run apt-get update, which then allowed me to run rvm install ruby.
Edit google-chrome.list (assuming you’re on the Stable Channel):
sudo gedit /etc/apt/sources.list.d/google-chrome.list
In the text file that opens edit the file so that the line reads:
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
Try to update again:
sudo apt-get update
Try to run RVM again:
rvm install ruby
this problem caused in apt-get update so you have to disable the PPA :
System Settings>Software & Updates>Other Software
then reinstall.
this image show disable PPA
I was facing the same problem and just did that:
sudo rm /etc/apt/sources.list.d/webupd8team-ubuntu-sublime-text-3-bionic.list
Now it works!
I faced the same problem while executing the command
curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails
It appeared to be that I was using the command as not a previleged user. So, using
sudo curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails
solved the problem
Below solution is to solve the rvm requirment error returns 100
If any deb command is commented in /etc/apt/sources.list than try to uncomment that command from /etc/apt/sources.list
Command is:
$sudo vi /etc/apt/sources.list
If problem is not solved than replace sources.list file with other Ubuntu's sources.list
Command is:
$mv /etc/apt/sources.list
Please make a backup before doing that
Command is:
$cp /etc/apt/sources.list sources_backup.list
Problem should solve by this time, if not than reinstall the Ubuntu.
Note: If sources.list file is corrupted than it will gives problem to install other packages.
I had a permission problem, solved with:
sudo chmod 777 log
I had the above error on installing ruby-2.3.0 in Ubuntu 16.04.
Go to the file:
/etc/apt/sources.list.d/mc3man-ubuntu-trusty-media-xenial.list
and remove the below:
deb-src http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
then run sudo apt-get update and after rvm install ruby-2.3.0 it's working.
you can temporarily disable updates by this
sudo apt-get update | grep "Failed"
Ruby RVM apt-get update error

Installing RVM on existing ruby1.8 installation

I have a big problem with my Debian server configuration. Someone before me has made a big mess with ruby installation and now i can't manage to get it all working. What i'm trying to do now is to get back to environment, where ruby1.8 is installed and rails app is working correctly with apache+passenger. If it would be working on RVM it would be perfect. Here is the story:
There was ruby 1.8 installed on a server. The person has removed it with sudo apt-get remove ruby1.8 and then installed version 2.0.x manually using those commands:
mkdir /tmp/ruby && cd /tmp/ruby
curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz
cd ruby-2.0.0-p247
./configure
make
sudo make install
Then, he has removed all the dirs listed by whereis ruby with rm command.
And here i came - i want to install RVM on this server. The problem is, no matter what i do, i get a lot of errors from all sides. Steps i've done:
# Install RVM
curl -L https://get.rvm.io | bash -s stable
# install 1.8.7 version
rvm install 1.8.7
# use 1.8.7
rvm use 1.8.7
# Install gems
bundle install
First thing (and that's just a tip of iceberg) is that i'm not able to start apache2 in cause of the following error:
apache2: Syntax error on line 203 of /etc/apache2/apache2.conf: Syntax
error on line 1 of /etc/apache2/mods-enabled/passenger.load: Cannot
load
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/libout/apache2/mod_passenger.so
into server:
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/libout/apache2/mod_passenger.so:
cannot open shared object file: No such file or directory Action
'configtest' failed.
Looks like there is even no /usr/lib/ruby/ dir on my system right now.
The question is: is there any way to reset all ruby-releated libraries on debian to the original state (debian without ruby installed) and install working RVM on top of that? Thanks in advance for any help.
Verify if, Is ruby installed correct by ruby -v
Install phusion passenger
$ sudo gem install passenger
$ sudo passenger-install-apache2-module
and then follow onscreen instructions

Gem Command not found

I have installed gem on Ubuntu 10.10 32 bit with
apt-get install gem -y
But when I try to run
gem install something.gem
I get the error of the command not being found.
bash: gem: command not found
I installed gem, is there any reason it is saying it can't find the command?
These files were install by gem package
http://pastie.org/3483416
Try the following:
sudo apt-get install rubygems
Are you wanting ruby gems? If so, you need to install libgemplugin-ruby and then the ruby 'gem' program will be in your path:
aptitude install libgemplugin-ruby
The following command installs ruby gem for ubuntu:
apt-get install libgemplugin-ruby
I did it after ruby was installed.
Installing this package allows you to use gem command on Debian 8:
apt-get install rubygems-integration
To install a gem package you might also need:
apt-get install ruby ruby-dev
On Debian, Ubuntu or Linux Mint:
$ sudo apt-get install rubygems ruby-dev
On CentOS, Fedora or RHEL:
$ sudo yum install rubygems ruby-devel
FWIW, the equivalent package for RHEL/Fedora/CentOS/etc and SuSE/OpenSuSE appears to be called 'rubygems'.
The following command may help you
sudo apt-get install ruby
On Ubuntu 14.04,
apt-get install ruby ruby-dev
this will install gem for you.
On CentOS 7 you can do:
yum -y install rubygems-devel
That worked for me.
I had the same problem. What I did was:
sudo apt-get update
And then reinstall ruby-full
sudo apt-get install ruby-full
check that rvm is a function type rvm | head -1
I know this is kind of late for a response. But I did run into this error and I found a solution here:
https://rvm.io/integration/gnome-terminal
You just have to enable 'Run command as login shell' under the terminal preferences.
The following command will give you the list of files that the gem package installed:
dpkg -L gem
that should help you troubleshoot.
try
$ /usr/bin/pd-gem
or
$ pd-gem
On Centos 8:
eventually, download the file of the application:
wget https://rubygems.org/downloads/asciidoctor-2.0.16.gem
then execute:
yum install -y rubygems ruby-devel
gem install asciidoctor
More: I tried positively also in a container (using the appropriate RUN and COPY statements before the commands).

Resources