How do play a video file in a ruby project? - ruby

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

Related

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.

What exact dependencies does Ruby need on Ubuntu?

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.

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

Installing OpenSSL on Ubuntu for Rails development?

I am running the latest RVM on Ubuntu 10.10 and I managed to get most of the development environment running, except for OpenSSL.
When I try to install the package I get the following error:
$ rvm package install openssl > error
ERROR: Error running 'tar zxf /home/ruby/.rvm/archives/openssl-0.9.8n.tar.gz -C
/home/ruby/.rvm/src', please read /home/ruby/.rvm/log/openssl/extract.log
ERROR: Error running './config -I/home/ruby/.rvm/usr/include -L/home/ruby/.rvm
/usr/lib
--prefix=/home/ruby/.rvm/usr zlib no-asm no-krb5 shared ', please read /home/ruby
/.rvm/log/openssl/configure.log
ERROR: Error running '/usr/bin/make ', please read /home/ruby/.rvm/log/openssl/make.log
ERROR: Error running '/usr/bin/make install', please read /home/ruby/.rvm/log/openssl
/make.install.log
It seems that the original downloaded file is corrupt when I get it via RVM. So, I downloaded and unpacked it to ~/.rvm/src/openssl0.9.8 and the first error is gone (error running tar zxf), but I still get the other ones.
Edit: my Ruby version, if anyone cares, is:
$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
Did you run rvm requirements after installing RVM? It shows a list of all needed dependencies, and supplies the recommended "apt-get" command.
/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
This will install openssl and libssl-dev, both of which are required. I've installed RVM and Ruby many times on Ubuntu and always used RVM's recommended way without a problem.
Do you have libssl installed in Ubuntu?
sudo apt-get install libssl0.9.8
Also install the development package:
sudo apt-get install libssl-dev

Problem when installing Ruby using RVM

I am having a hard time trying to reinstall Ruby (1.9.2-p136) on my ubuntu machine, using RVM.
Basically I just do:
rvm install 1.9.2-p136
And during the Compiling step, it fails with the following error message:
(NoMethodError) undefined method
`set_encoding' for RDoc::Parser:Class
I tried to look for this on Stackoverflow and Google but it didn't help!
Any idea?
Thanks!
EDIT:
To be clear, I am not using Ubuntu but Linux Mint 9 which is based on Ubuntu 10.04.
Well, oddly enough, RDoc was rev'd last week to a new version. So, I suspect you're running into a snag with it, maybe Ruby 1.9.2-p136, and maybe RVM.
I'd recommend contacting the author of RVM; You can email him at the address that appears when you do rvm -v. Include the output of rvm info.
I'll do an install to a VM on my machine here and see how it goes. I have the same Ruby version, but it's been in place since it came out, so when RDoc updated there was an existing Ruby. I have the most recent Mint, which I assume is 9, based on Ubuntu 10 I think it said.
EDIT:
I just built a Mint 10 VM, then installed rvm, then installed 1.8.7-p330 and 1.9.2-p136. Neither had any problems.
One thing I didn't do, that Wayne Seguin told me is important, is to rvm notes after installing it, before installing Ruby. That will display any OS-specific things needed. For instance, on Mint 10 it says:
dependencies:
For RVM
rvm: bash curl git
For Ruby (MRI & ree) you should install the following OS dependencies:
ruby: /usr/bin/aptitude 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
EDIT:
An additional thing you might run into is a zlib warning when installing gems, which is handled on the RVM site in Zlib
I don't know what your problem is, but I've had to install rails to a couple of ubuntu machines and it was a nightmare compiling everything. I recently found:
http://thechangelog.com/post/2857400260/railsready-setup-script-to-get-ruby-and-rails-running
This is the only way I would install rails in ubuntu.

Resources