What are ruby 1.9.3 dependencies - ruby

I'm trying to determine the fewest packages that I need to install before installing ruby from source. I've dug through ruby source a little and I figured it might be faster to ask here.
Does anyone have a list or know how to dig up this information?

It's all in the READMEs...
For Unix-like platforms including Mac OS, no extra requirement per say besides a C compiler (C89 is the official target, even for Ruby 2.0.0).
For Windows:
Windows XP or later.
Visual C++ 6.0 or later.
Commands:
nmake
cl
lib
dumpbin
This can be surprising, but libraries like libyaml or zlib are not required. Ruby will use its bundled libyaml if need be. If zlib is not installed, then Ruby will work, but require 'zlib' external library will not work.
RTFM for more details.

According to its gentoo ebuild: berkdb, gdbm, ssl socks5, tk, ncurses, readline, yaml, libffi, zlib, libedit.

Related

Nokogiri for Ruby on WindowsXP: 6 hours of my life gone

I just want to install Nokogiri for Ruby on my Windows XP. The process is apparently so obfuscated and divergent that I have about 50 different tabs and windows open trying to install Libxml, devKit, other versions of what I already have, and so on. Does anybody know the secrets of how to install Nokogiri for Ruby on Windows?
Configuration
On my Windows XP, Version 2002 SP3, I have the following directories:
List item
C:\RailsInstaller\Ruby1.9.3
C:\Ruby200
C:\libxml2-2.9.1
C:\DevKit
C:\Python27
C:\Python33
Both ruby's are installed, I have no idea about the DevKit or the libxml. The libxml2-2.9.1 is some kind of python source, so I thought it would be a great idea to install python, which I know nothing about, and try to compile it; hence the two python folders.
I have
libxml-ruby 2.6.0 [rdoc] [www] - depends on hanna_guado.
Ruby Bindings for LibXML2
libxslt-ruby 1.1.0 [rdoc] [www] - depends on libxml-ruby.
Ruby libxslt bindings
installed on ruby, but when I go to do a "gem install nokogiri" it still gives me a
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb checking for libxml/parser.h... no
----- libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with
installing dependencies.
I'd strongly recommend looking into the Bitnami one-click Ruby installers. They might work with XP.
Otherwise I'd try running a VM with a small Linux guest system. It would be a lot less pain.
Windows isn't exactly friendly to open-source languages and yours is pretty old. Finding the individual components installed is hard enough without a full installer on a current version of the OS, on an old one it's harder and becomes like herding cats.
OS languages fit Linux nicely, and work pretty well with Mac OS because it's *nix based.
Those are the things I'd try instead of what you are doing.
http://bitnami.com/

OSX Lion: export CC for rvm and homebrew enough? What about CXX, CPP, CXXPP

As I had major troubles installing ruby 1.8.7 on OSX Lion I did like it was proposed i.e. in one answer to Why can't I install Rails on Lion using RVM? and set my CC environment variable. I also used https://github.com/kennethreitz/osx-gcc-installer to get the non-LLVM gcc.
I read that there could be problems with brews also, and gcc_select doesn't seem to be available anymore, so I decided to put this into my .zshrc:
# Lion ships with llvm-gcc-4.2 as default compiler, fix that as it breaks rubies and brews
export CC=/usr/bin/gcc-4.2
export CXX=/usr/bin/g++-4.2
Now I'm wondering if there are other variables I should set, like CPP, CXXPP, LD, you name it. I'm not a gcc expert so could anyone lighten me up? What's the best practice here? I don't want to compile everything again so I figured I better ask :-)
There should be nothing else to set. If you install ox-gcc-installer alone, it will handle installing any and all ruby and gem setups. Ruby uses C, and thus, gems that are natively compiled are also C based. Setting CPP and CXX are basically the same thing as CXX is for the C++ compiler binary, as well as CPP.
The only issue you should have with osx-gcc-installer and what you can do with RVM is that Node.js relies on Carbon headers which are only in the Xcode installer package, not osx-gcc-installer as its a strip job. That can easily be fixed by simply installing Xcode directly over osx-gcc-installer. Xcode sees it as an upgradable Xcode install.

How do I install the Perl DateTime module on Mac OSX 10.6

Ok, I know how to install Perl modules with cpan and have been doing it for years. But when I try to install the DateTime module on this particular mac, it fails, claiming that it cannot find a compiler.
Here is some of the output from attempting to install one of the prerequisites, Params::Validate: ( I get the same kinds of errors from attempting to install the module in question.)
Configuring Params-Validate-1.00
Running Build.PL
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
lipo: can't open input file: /var/tmp//cc3Aefez.out (No such file or directory)
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build
Why is Build.PL looking for a ppc compiler? If that is the problem where do I tell it (or cpan, or cpanm) that this machine is not a ppc box?
I'm running 10.6.8. The version of perl is v5.10.0 built for darwin-thread-multi-2level
I most definitely have the Developer tools installed.
I'm running cpan and cpanm via sudo.
I'd be grateful for any assistance anyone can offer.
known problem with Xcode on Lion, Apple couldn't help messing around with nm, breaking Perl again (previously) and who knows what else
p5p discussion
perlbrew's info
You are on an unsupported Perl. Upgrade to stable.
I've got 10.7 installed which comes with Perl 5.12.3 installed. I did a CPAN install:
$ sudo cpan
password:
cpan> install DateTime
And, the whole thing works. Is this something you need for a third party file, or do you want to use this because you're familiar with this particular package?
There are several built in Time packages with Perl 5.10. Would one of these work for you? Otherwise, you might need to install ExtUtils::CBuilder and see if that helps.
Or, install a more modern version of Perl such as ActiveState which is pretty simple to install, its cpan utility works pretty good on a Mac, and it's version 5.14 which is even newer than the version that comes with Lion.
I think what's happening is that the installer is trying to compile something (possibly an XS module) and to do that it needs to use the same compiler that was used to compile whichever version of Perl is on your system, and it can't find it.
Your best bet would be to install your own version of Perl 5.10 using perlbrew as this gaurantees the compiler is available (make sure you edit your .profile so Terminal uses your new Perl), then re-open Terminal, switch to the perlbrew version of Perl 5.10 and you should be fine from then on.
If you have problems installing the perlbrew Perl then as daxim noted above refer to the Lion fix

Where can I find instructions on how to install Vala on my Mac?

I'm looking into learn the Vala programming language where can I find somewhere to show me how to install it on my Mac?
Another way to install it is using Homebrew.
brew install vala
The advantage of Homebrew over Macports is that it tries to rely as much on what is provided by the native OS as possible without installing any additional duplicate libraries.
A good way to install it is to use MacPorts. MacPorts gives you access to Vala and many of the libraries often used with Vala.
I'd start with MonoDevelop and it's installation instructions. There's a Vala plug-in for it.

Is there an easy way to enable Tk for Ruby in OS X v10.6+?

Starting with Snow Leopard (OS X v10.6) Apple bundles 64-bit ruby by default. Unfortunately, there is no 64-bit Tk bundled, so the following ruby code will fail:
require 'tk'
Is it some easy way to enable Tk for Ruby in Snow Leopard and higher? Like installing 32-bit ruby or whatever. I have tried to recompile Ruby with Tk support but it seems not that easy - tutorials found in google refers to some options in Ruby's ./configure script that don't exists in actual Rby code downloaded from official site :(. I will be glad for any hints - i have a Ruby app with Tk GUI and need to enable my users to use it :)
Tk builds fine in 64-bit mode on OSX, but only if you've got sources from the 8.6 series«ZIP»«TGZ» (still in beta for various reasons, but quite usable). You'll want to ensure you configure with --enable-aqua --enable-64bit of course, but I assume that's pretty much obvious.
(Alas, I can't say how to then integrate the build of Tk with your Ruby installation, though there is some documentation online that seems to be somewhat relevant. I emphasize that I've only googled for it though; on this I don't speak from experience.)
Where was a great improvement over Tk documentation recently. Not they has complete instructions on how to enable Tk for Ruby on OSX 10.6+. This requires ActiveTcl 8.5+ binary distribution and compiling ruby from source. The command i used on OSX 10.7 with XCode 4.2 to compile ruby and replace stock ruby installation (dangerous!):
./configure --prefix=/usr --with-arch=x86_64,i386 --enable-pthread --enable-shared --with-gcc=clang
make
sudo make install

Resources