# Ruby ports confused



## BeastieBoy (Jun 28, 2010)

Hi,

So first Ruby1.8.7 got automatically installed when I wanted to install Nginx. But I really wanted to try Ruby1.9 so I reinstalled Nginx and Ruby. But Rails has problems with Ruby1.9 so I want to revert back to Ruby1.8, but now it's confused, and me as well:


```
cd /usr/ports/lang/ruby18
# make install clean
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for ruby-1.9.1_2,1
===>  Extracting for ruby-1.9.1_2,1
=> MD5 Checksum OK for ruby/ruby-1.8.7-p248.tar.bz2.
=> SHA256 Checksum OK for ruby/ruby-1.8.7-p248.tar.bz2.
```
Why is it detecting a Ruby1.9 conf file? How to clean things up? I always run make clean after the installation, why is it happening?


----------



## jb_fvwm2 (Jun 28, 2010)

```
make rmconfig
/bin/rm -rf work
```
run those two in 
/ruby18/ and /ruby19/
then select options in the
one you want to install
(probably also)

```
touch __leave_iconv_after_build.TODO
```
run that command in the one to install
so ruby-iconv will build later...


----------



## BeastieBoy (Jun 29, 2010)

I'm going down deeper and deeper:

```
$ sudo gem18 install pg
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

/usr/local/bin/ruby18 extconf.rb
checking for pg_config... yes
/libexec/ld-elf.so.1: Shared object "libiconv.so.3" not found, required by "libintl.so.9"
/libexec/ld-elf.so.1: Shared object "libiconv.so.3" not found, required by "libintl.so.9"
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
```
What's missing? iconv as a port, as a gem, as something else?

Should I reinstall my server from scratch and get a book on how to manage ports in FreeBSD? I'm just messing things up, and the handbook doesn't really teaches good/best practices on each topic.


----------



## jb_fvwm2 (Jun 29, 2010)

/usr/ports/converters/libiconv somehow got 
uninstalled or missing or ... gettext depends
on it. (You probably have gettext installed
without libiconv)
...
Search the web maybe for "upgrading ports" "freebsd"
(onlamp.com maybe too)


----------



## wblock@ (Jun 29, 2010)

BeastieBoy said:
			
		

> /libexec/ld-elf.so.1: Shared object "libiconv.so.3" not found, required by "libintl.so.9"
> /libexec/ld-elf.so.1: Shared object "libiconv.so.3" not found, required by "libintl.so.9[/code]
> What's missing? iconv as a port, as a gem, as something else?
> 
> Should I reinstall my server from scratch and get a book on how to manage ports in FreeBSD? I'm just messing things up, and the handbook doesn't really teaches good/best practices on each topic.



You upgraded libiconv without upgrading the ports that depend on it.
`# portupgrade -rf libiconv`

Could reinstall your server, but unless you do things differently the same problems will occur.


----------



## BeastieBoy (Jun 30, 2010)

Is there an equivalent to portupgrade -rf using only system tools (make, pkg_add, etc)?


----------



## wblock@ (Jun 30, 2010)

BeastieBoy said:
			
		

> Is there an equivalent to portupgrade -rf using only system tools (make, pkg_add, etc)?



Not that I'm aware.  There are other port utilities that do the same thing, like portmaster and portmanager, but they're ports, too, not part of the base.

`# pkg_info -R libiconv\*`
will show the ports that depend on libiconv, but not in the order they need to be rebuilt.  pkg_sort would sort those into the right order, but it's part of portupgrade.

If your installed applications are hopelessly messed up, you can pkg_delete all of them (-a) then update the ports tree and reinstall (just the applications, not the system).  Settings in /usr/local/etc should be mostly safe, although a backup is good idea anyway.


----------



## valuequest (Apr 9, 2011)

Okay so I've already installed lang/ruby19 on my 8.2-RELEASE system.

Now I want to install sysutils/fusefs-kmod for which the make process appears to ignore the existing lang/ruby19 installation and require lang/ruby18.  Can I get make to recognize the existing lang/ruby19 installation somehow?  Or alternatively will allowing lang/ruby18 to be installed break anything?


----------



## wblock@ (Apr 9, 2011)

/usr/ports/Mk/bsd.ruby.mk shows you can set a default version, but I don't know if more is required to do it right.  Consider that the ports system currently expects ruby1.8.

/etc/make.conf

```
RUBY_DEFAULT_VER=       1.9
```


----------



## jb_fvwm2 (Apr 10, 2011)

FWIW, I'd an older laptop for which ruby18 took days to actually install. I switched to ruby19 (reportedly a fix for that issue in 2009) but a few ports still required ruby18 (portupgrade IIRC) so had to revert and pkg_add (IIRC). (Not a ruby18 bug on processors, say, pentium-4 or faster).


----------

