installing RSRuby in Ubuntu 10.04 - r

I'm trying to install RSRuby on Ubuntu 10.04. I barely even know what error messages to report as the relevant ones; I've just been googling around for several hours and none of the commands I try solve the problem.
Here are a few sample error messages:
$ sudo gem install rsruby -- --with-R-dir=/usr/lib/R
Building native extensions. This could take a while...
ERROR: Error installing rsruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-R-dir=/usr/lib/R
checking for main() in -lR... yes
checking for R.h... no
ERROR: Cannot find the R header, aborting.
Gem files will remain installed in /var/lib/gems/1.8/gems/rsruby-0.5.1.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/rsruby-0.5.1.1/ext/gem_make.out
or doing it with apt-get:
$ sudo gem install rsruby --include-dependencies -- --with-R-dir=/usr/lib/R/lib64/R --with-R-lib=/usr/lib/R/lib64/R/bin --with-R-include=/usr/lib/R/lib64/R/include
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Building native extensions. This could take a while...
ERROR: Error installing rsruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-R-dir=/usr/lib/R/lib64/R --with-R-lib=/usr/lib/R/lib64/R/bin --with-R-include=/usr/lib/R/lib64/R/include
checking for main() in -lR... no
ERROR: Cannot find the R library, aborting.
Gem files will remain installed in /var/lib/gems/1.8/gems/rsruby-0.5.1.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/rsruby-0.5.1.1/ext/gem_make.out
I also got the latest RSRuby from GitHub and following the instructions from its 2006 PDF manual:
$ ruby setup.rb config -- --with-R-dir=/usr/lib/R
---> lib
---> lib/rsruby
<--- lib/rsruby
<--- lib
---> ext
/usr/bin/ruby1.8 /home/mars/R/rsruby/ext/extconf.rb --with-R-dir=/usr/lib/R
checking for main() in -lR... yes
checking for R.h... no
ERROR: Cannot find the R header, aborting.
*** /home/mars/R/rsruby/ext/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=/home/mars/R/rsruby/ext
--curdir
--ruby=/usr/bin/ruby1.8
--with-R-dir
--with-R-include
--without-R-include=${R-dir}/include
--with-R-lib
--without-R-lib=${R-dir}/lib
--with-Rlib
--without-Rlib
setup.rb:655:in `command': system("/usr/bin/ruby1.8" "/home/mars/R/rsruby/ext/extconf.rb" "--with-R-dir=/usr/lib/R") failed (RuntimeError)
from setup.rb:660:in `ruby'
from setup.rb:1238:in `extconf'
from setup.rb:1230:in `config_dir_ext'
from setup.rb:1532:in `__send__'
from setup.rb:1532:in `traverse'
from setup.rb:1549:in `dive_into'
from setup.rb:1530:in `traverse'
from setup.rb:1524:in `exec_task_traverse'
from setup.rb:1519:in `each'
from setup.rb:1519:in `exec_task_traverse'
from setup.rb:1223:in `exec_config'
from setup.rb:991:in `exec_config'
from setup.rb:826:in `__send__'
from setup.rb:826:in `invoke'
from setup.rb:773:in `invoke'
from setup.rb:1578
and in irb:
irb(main):002:0> require 'RSRuby'
LoadError: no such file to load -- RSRuby
from (irb):2:in `require'
from (irb):2
from :0
irb(main):003:0> rsruby
NameError: undefined local variable or method `rsruby' for main:Object
from (irb):3
from :0
Sometimes I'm seemingly able to get something that looks like it works, but still can't load rsruby from the irb command line.
$ sudo gem install rsruby --include-dependencies -- --with-R-dir=/usr/lib/R --with-R-lib=/usr/lib/R --with-R-include=/usr/share/R/include/
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Building native extensions. This could take a while...
Successfully installed rsruby-0.5.1.1
1 gem installed
Installing ri documentation for rsruby-0.5.1.1...
Installing RDoc documentation for rsruby-0.5.1.1...
then
$ irb
irb(main):001:0> require 'rsruby'
LoadError: no such file to load -- rsruby
from (irb):1:in `require'
from (irb):1
from :0
Ruby is version 1.8.7, I did sudo apt-get install ruby1.8-dev today but I'm not sure if that left things worse, better, or unchanged. Or if this would be easier in ruby1.9.
R is working.

I don't read Japanese but this worked for me on Ubuntu 10.10, ruby 1.9: http://d.hatena.ne.jp/cuspos/20090520/1242825057
# gem install rsruby-0.5.1.1.gem -- --with-R-dir=/usr/lib/R --with-R-include=/usr/share/R/include
Building native extensions. This could take a while...
Successfully installed rsruby-0.5.1.1
1 gem installed
# export R_HOME=/usr/lib/R
# irb
irb(main):001:0> require 'rsruby'
=> true
irb(main):002:0>

You might want to check to see if your PATH variables or dynamic links are set up so that Ruby and friends are "looking" in the right place. Ruby appears to expect RSruby to be in /var/lib/gems/1.8/gems/rsruby-0.5.1.1/ or perhaps /usr/lib/ruby/1.8/rubygems/ or perhaps /var/lib/gems/1.8/gems/rsruby-0.5.1.1/lib/, .... while your configure report says it was installed in /usr/bin/ruby1.8 /home/chris/R/. I don't have a ton of Linux experience, but what I do have tells me that each distro is different with respect to where it expects to find installed executables.

Your attempts with apt-get and gem install suggest that the installer cannot find the R header files. I would start by fixing this problem, not try other ways of installing RSruby. The next question is why it cannot find the R headers, there are two options:
The headers are installed, but they cannot be found. Use locate R.h to find where the R header file is located, and make sure this is in your $PATH.
The headers are not installed (which I suspect is the case). Often installing header files requires a development package to be installed. Try and see if there is an R-dev package or something named similarly which would contain, among others, the R header file. Installing this R-dev can be done using apt-get. The standard version of R in ubuntu 10.04 is not really up-to-date I think. CRAN has ubuntu repositories, where the dev package is called r-base-dev. Adding this repo to your sources.list gets you the latest version of R from CRAN through apt-get.

You have successfully installed rsruby, as shown by the output from your 5th example:
Successfully installed rsruby-0.5.1.1
1 gem installed
The library did not load in irb because using Ruby 1.8.7, you need to "require rubygems" first. Try this in irb:
require 'rubygems'
require 'rsruby'

Related

Initial Rattle issues (Os) "Error: -with-x11" & "Error: gtk+ 2.24.32 did not build"

I have been trying to install Rattle on my Os into my R using this instructions:
https://zhiyzuo.github.io/installation-rattle/
I get to Line 7 and input
~$ brew install --with-x11 cairo
and then get
Updating Homebrew...
Usage: brew install [options] formula|cask
Install a formula or cask. Additional options specific to a formula may be
appended to the command.
Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for
the installed formulae or, every 30 days, for all formulae.
...
**Error: invalid option: --with-x11**'''
Ive tried to continue on installing Cairo without the "--with-x11" (as been suggested they no longer support that).
So I did just "brew install cairo" that worked.
I go to line 9 Now we can install gtk+ by:
~$ brew install --build-from-source --verbose gtk+
And I get:
**Error: gtk+ 2.24.32 did not build
Logs:
/Library/Logs/Homebrew/gtk+/00.options.out
/Library/Logs/Homebrew/gtk+/01.configure.cc
/Library/Logs/Homebrew/gtk+/config.log
/Library/Logs/Homebrew/gtk+/01.configure
READ THIS: https://docs.brew.sh/Troubleshooting'''
If this helps in the last part I see in the terminal things saying:
==> ./configure --disable-dependency-tracking --disable-silent-rules - -prefix=/usr/local/Cellar/gtk+/2.24.32_3 --disable-glibtest --enable-introspection=yes --with-gdktarget=x11 --enable-x11-backend
configure: WARNING: unrecognized options: --enable-x11-backend
and
configure: error: Package requirements (cairo-xlib >= 1.6) were not met:
No package 'cairo-xlib' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables CAIRO_BACKEND_CFLAGS
and CAIRO_BACKEND_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Anyone have any suggestions for this ?
Thanks.

installing R 3.3.2 in HOME directory in centos

I am trying to install R 3.3.2 on a server running centos 6. I have to install it in my Home directory on the server because i don't have the permissions anywhere else. I downloaded it using wget and then tar. But when I reach the point of "./configure" in order to run "make" afterwards it stops with an error.
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required
I installed zlib 1.2.8 and added its path to my bash_profile then tried to run the command ./configure for the R again but i got the same error. It seems that it still sees that I am using an old version of zlib (1.2.3) (The one that is already installed on the server). Have anyone had a similar issue or have any advices regarding this ? Thanks in advance
and added its path to my bash_profile
I am curious if you prepended or appended the path. In the latter case, configure will detect the old zlib.
In order to prepend, do like
export LD_LIBRARY_PATH=/path/to/zlib/inst/dir/lib:${LD_LIBRARY_PATH}

Setting up IJulia

I am trying to set up IJulia on my PC, but after I get it running I get the constant messages that "kernel has died" and there is a problem with ZMQ library.
Trying to rebuild or reinstall ZMQ does not work. I get an error:
================================[ BUILD ERRORS ]================================
WARNING: ZMQ had build errors.
- packages with build errors remain installed in C:\Users\Gisaev\.julia\v0.3
- build the package(s) and all dependencies with `Pkg.build("ZMQ")`
- build a single package by running its `deps/build.jl` script
Trying to execute build.jl by line (part that correspond to windows) I get the error "Provider PackageManager faild to satisfy dependency zmq."
I am kind of lost here, because ZMQ is obviously correctly installed and working for IPython - IPython notebooks work just fine; I have a fresh installation from Anaconda.
Try to run
Pkg.build("ZMQ")
to see what happens.
If there are warnings about "libpgm" and "zeromq32", you can delete the lib directories and then try to build ZMQ again.
rm -rf /Users/username/.julia/v0.x/Homebrew/deps/usr/Cellar/zeromq32/3.2.5
rm -rf /Users/username/.julia/v0.x/Homebrew/deps/usr/Cellar/libpgm/5.2.122
Pkg.build("ZMQ")
This will correctly build the libpgm and zeromq32 you needed.
(I suppose the operation system is OS X. If you are using Windows, please refer to Installing ZMQ on Windows 7+ seems to require admin privileges #69.)

compiling programs in scientific linux (pcre)

I'm currently trying to install gtk3 on scientific linux (It is not available on official repositories)
I'm well used to yum, apt, pacman etc but i'm a little lost here when it's about compiling ...
to install gtk3, i need glib, to install glib, i need pcre 8.32.
I thus downloaded the tarball from their site.
Once 'untarred', i followed what is written on that link :
http://www.linuxfromscratch.org/blfs/view/svn/general/pcre.html
but once i've made './configure' with its options, 'make', and then 'make install' glib doesn't configure any better... it says my version is still the old version
configure: error: Package requirements (libpcre >= 8.13) were not met:
Requested 'libpcre >= 8.13' but version of libpcre is 7.8
The files seems to be well compiled but not 'moved correctly to the right place' ...
Did i miss something ?
By the way moving to another distro is not an option :P

Firewatir: Error when installing Firewatir on Windows

I am trying to install Firewatir on my PC (its OS is Windows). I have installed the jssh and test it. It is properly installed.
After that, I tried to install the firewatir gem. So I ran this command:
gem install firewatir
Then, I got this error:
ERROR: While executing gem ... (RunTimeError)
Error installing firewatir:
firewatir requires commonwatir = 1.6.5
Does that mean I have to install commonwatir first? When I tried to install commonwatir, I got similar error. But this time, the commonwatir required user-choices. And now, it becomes a long dependence chain of installation.
Watir installation page says all you need to do is
gem install watir
Firewatir is part of Watir.

Resources