What exact dependencies does Ruby need on Ubuntu? - ruby

When reading how to install Ruby on Ubuntu, I frequently see this kind of thing:
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
But which of these packages are actually needed and which are nice to have?
And also... why?
I can't seem to find any good information online that answers this question.

apt-cache showpkg <specific-ruby-version-package> will show you the package dependencies. As above comment says, apt-get install ... will automatically install the dependencies. Anything people are installing beyond that may have to do with their development environment or the ability to build specific gems with native extensions.

Related

error while installing new version of ruby using RVM

I'm switching my ruby version using RVM
rvm install 2.6.3
I get this error:
Installing required packages: libssl-dev...
Error running 'requirements_debian_libs_install libssl-dev',
please read /home/bondka/.rvm/log/1562836140_ruby-2.6.3/package_install_libssl-dev.log
Requirements installation failed with status: 100.
If you are using Ubuntu update your package repository (optional- ignore if already did).
sudo apt-get update
then run
sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
I hope that helpful.

Unable to install Ruby gem unf_ext 0.7.4 on Ubuntu

I am having a hell of a time installing unf_ext 0.7.4 on Ubuntu. I've tried every form of Google searching you can possibly imagined and installed almost everything I could think of, here's what I've installed so far:
libgmp-dev
ruby-dev
zlib1g-dev
liblzma-dev
build-essential
build-essential patch
libxml2
libxslt1.1
openssl
libreadline6
libreadline6-dev
curl
git-core
zlib1g
zlib1g-dev
libssl-dev
libyaml-dev
libsqlite3-0
libsqlite3-dev
sqlite3 (found a link somewhere that said this would help?)
libxml2-dev
libxslt-dev
autoconf
libc6-dev
ncurses-dev
automake
libtool
bison
However after having all of these installed it still does not work, so I tried
sudo apt-get update && sudo apt-get install libxml2-dev && sudo apt-get install libxslt-dev && sudo gem install unf_ext
During that I get this error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libxml2-dev : Depends: libxml2 (= 2.9.1+dfsg1-3ubuntu4.9) but 2.9.4+dfsg1-2.2 is to be installed
E: Unable to correct problems, you have held broken packages.
However, dpkg --get-selections displays no packages on hold and all are installed. How can I successfully get this gem installed?
I ran into a similar issue with installing unf_ext on Ubuntu. I had to add a swapfile to my server. Once I did that I was able to install the unf_ext gem.

Running Metasploit on Ubuntu Error

http://www.darkoperator.com/installing-metasploit-in-ubunt/
Here is the site I used for the installation process
I typed
msfconsole
after install rbenv ruby (I know its a longer installation, but I still did), and got this error.
/usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:370:in
parse: (/opt/metasploit-framework/config/database.yml): mapping
values are not allowed in this context at line 9 column 22
(Psych::SyntaxError)
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:370:in
parse_stream
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:318:in
parse
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:245:in load
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:464:in block
in load_file
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:464:in open
from /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/2.1.0/psych.rb:464:in
load_file
from /opt/metasploit-framework/lib/msf/ui/console/driver.rb:164:in
initialize
from /opt/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in
new
from /opt/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in
driver
from /opt/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in
start
from /opt/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in
start
from /usr/local/bin/msfconsole:48:in
Please help!!!
Complete credit to Iraklis Mathiopoulos #https://medium.com/#iraklis/sometimes-you-need-metasploit-running-on-a-box-with-a-public-ip-in-order-to-get-reverse-shells-to-74fda07165a5#.2tplo6bnh:
Installing the Pre-requisites.
adduser msfdev
adduser msfdev sudo
apt-get update
apt-get -y install autoconf bison build-essential curl git-core libapr1 libaprutil1 libcurl4-openssl-dev libgmp3-dev libpcap-dev libpq-dev libreadline6-dev libsqlite3-dev libssl-dev libsvn1 libtool libxml2 libxml2-dev libxslt-dev libyaml-dev locate ncurses-dev openssl wget xsel zlib1g zlib1g-dev
Using msfdev for install
su - msfdev
wget https://raw.githubusercontent.com/iam1980/metasploit-vps-installer/master/msf_vps_installer.sh
bash msf_vps_installer.sh
I generally always use the free installer to install a standalone version of metasploit.
it is outlined here under installation.
You can simply git clone and then install
git clone https://github.com/rapid7/metasploit-framework.git

How do play a video file in a ruby project?

I found a rvideo library but manual very small and I'm learning ruby one day.
I need play a video in window. How have me done it? There is possibility cause the video player from a ruby code? or have any other way done my task?
Ok, first thing I would do is install RVM and follow the instructions which should tell you what other packages you need to install, the error you received is cause you don't have the build-essential installed. per rvm you need to install
rvm requirements
...
For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkgconfig
After RVM is installed with the packages you need, go ahead and install the flavors or Ruby you need.
Unfortunately Rubuto isn't a subsitute for learning the andriod API, the revelevent API that you need is here http://developer.android.com/guide/topics/media/mediaplayer.html you will just need to make the right API calls and references in your Rubuto/JRUBY project

Fresh install of RVM in Ubuntu isn't letting me install gems (zlib error)

Ok, I just created a fresh Ubuntu 11.04 install on Windows 7 using VirtualBox (not sure if this matters or not but just an fyi)
listing my rubies I get:
aaron#aaron-VirtualBox:~$ rvm list
rvm rubies
=> ruby-1.9.2-p290 [ x86_64 ]
but then trying to install the rails gem I get this:
aaron#aaron-VirtualBox:~$ gem install rails
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
aaron#aaron-VirtualBox:~$
What am I doing wrong?
Edit:
After doing what Dylan said my output (to prove those libraries are now installed):
aaron#aaron-VirtualBox:~$ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
[sudo] password for aaron:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
Note, selecting 'libncurses5-dev' instead of 'ncurses-dev'
autoconf is already the newest version.
bison is already the newest version.
build-essential is already the newest version.
git-core is already the newest version.
libc6-dev is already the newest version.
libncurses5-dev is already the newest version.
libreadline6 is already the newest version.
libreadline6-dev is already the newest version.
libsqlite3-0 is already the newest version.
libsqlite3-dev is already the newest version.
libssl-dev is already the newest version.
libxslt1-dev is already the newest version.
libyaml-dev is already the newest version.
openssl is already the newest version.
sqlite3 is already the newest version.
zlib1g is already the newest version.
zlib1g-dev is already the newest version.
curl is already the newest version.
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
aaron#aaron-VirtualBox:~$ gem install rails
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
aaron#aaron-VirtualBox:~$
Run rvm notes and make sure to use apt-get to install the things RVM tells you to. It (something along the lines of zlib1g-devel will be one of them).
For Ubuntu, it should be something like this:
/usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
You might have to recompile your 1.9.2 afterwards (not 100% sure of that).
I found that we need to install package zlib after installing above packages(that rvm said).
So we need to do:
rvm pkg install zlib
After that, re-install ruby.
rvm reinstall 1.9.3
Run
gem install rails
It will successfully install rails.
If you trust RVM you can run the following two commands. This
rvm requirements run
rvm reinstall all --force
Then the gem install rails command should work.
The first step will install all the packages that are needed for RVM. You do not normally need all, but it beats trying to search package by package.
Most people miss this part of the RVM install
Finally, see if there are any dependency requirements for your
operating system by running:
user$ rvm requirements

Resources