# ruby 1.9.3_1,1



## Mwh65 (Feb 21, 2014)

I'm still receiving the following ruby update error when using portupgrade ...


```
===>  ruby-1.9.3_1,1 has known vulnerabilities:
ruby-1.9.3_1,1 is vulnerable:
ruby -- Unintentional file creation caused by inserting an illegal NUL character
CVE: CVE-2012-4522
WWW: http://portaudit.FreeBSD.org/3decc87d-2498-11e2-b0c7-000d601460a4.html

ruby-1.9.3_1,1 is vulnerable:
ruby -- DoS vulnerability in REXML
WWW: http://portaudit.FreeBSD.org/844cf3f5-9259-4b3e-ac9e-13ca17333ed7.html

ruby-1.9.3_1,1 is vulnerable:
Ruby -- XSS exploit of RDoc documentation generated by rdoc
CVE: CVE-2013-0256
WWW: http://portaudit.FreeBSD.org/d3e96508-056b-4259-88ad-50dc8d1978a6.html

ruby-1.9.3_1,1 is vulnerable:
ruby -- $SAFE escaping vulnerability about Exception#to_s/NameError#to_s
CVE: CVE-2012-4466
CVE: CVE-2012-4464
WWW: http://portaudit.FreeBSD.org/2a093853-2495-11e2-b0c7-000d601460a4.html

ruby-1.9.3_1,1 is vulnerable:
Ruby -- Denial of Service and Unsafe Object Creation Vulnerability in JSON
CVE: CVE-2013-0269
WWW: http://portaudit.FreeBSD.org/c79eb109-a754-45d7-b552-a42099eb2265.html
=> Please update your ports tree and try again.
*** [check-vulnerable] Error code 1

Stop in /usr/ports/lang/ruby19.
*** [build] Error code 1

Stop in /usr/ports/lang/ruby19.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20140221-49108-1ftwlxv env UPGRADE_TOOL=portupgrade UPGRADE_PORT=ruby-1.9.3,1 UPGRADE_PORT_VER=1.9.3,1 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! lang/ruby19 (ruby-1.9.3,1)    (unknown build error)
```

Is there any reason for me not to upgrade to Ruby 2.0 and if it is okay what's the best way to upgrade it ?


----------



## SirDice (Feb 21, 2014)

Upgrade your ports tree, current version of lang/ruby19 is 1.9.3.484_1,1.


----------



## Mwh65 (Feb 21, 2014)

I really ought to be more thorough when I post topics.

I already updated the ports tree prior to trying again. The version showing is ...


```
[root@www ~]# ruby -vv
ruby 1.9.3p448 (2013-06-27 revision 41675) [i386-freebsd9]
```

So something isn't quite right.


----------



## SirDice (Feb 21, 2014)

What version does the Makefile of lang/ruby19 show? Something isn't quite right indeed. Do you happen to have both PKGNG and old packages installed? It may be a result of a botched pkg2ng.


----------



## Mwh65 (Feb 21, 2014)

The top 2 lines of the Makefile show ...


```
# Created by: Akinori MUSHA aka knu <knu@idaemons.org>
# $FreeBSD: head/lang/ruby19/Makefile 343678 2014-02-10 20:22:20Z swills $
```

I have upgraded to PKG and I seem to remember having issues with pkg2ng not working but cannot recall specifics of it.


----------



## SirDice (Feb 21, 2014)

Did you add WITH_PKGNG=YES to /etc/make.conf? If it isn't portupgrade(1) will use the old package tools. Those may not be in sync any more with what's really installed.


----------



## Mwh65 (Feb 21, 2014)

Yes that line is present in the /etc/make.conf file.

I ran pkg version which does list all the ports as up to date except ruby 1.9.3


```
9base-b20100604                    =
ImageMagick-6.8.0.7_5,1            =
ORBit2-2.14.19                     =
apache22-2.2.26                    =
apr-1.4.8.1.5.3                    =
atk-2.8.0                          =
autoconf-2.69                      =
autoconf-wrapper-20131203          =
automake-1.14                      =
automake-wrapper-20131203          =
bash-4.2.45_1                      =
bdftopcf-1.0.4                     =
bigreqsproto-1.1.2                 =
bison-2.7.1,1                      =
bitstream-vera-1.10_5              =
ca_root_nss-3.15.4                 =
cairo-1.10.2_7,2                   =
cmake-2.8.12.1                     =
cmake-modules-2.8.12.1_1           =
compositeproto-0.4.2               =
cscope-15.8a                       =
ctags-5.8                          =
cups-client-1.5.4_1                =
cups-image-1.5.4_1                 =
curl-7.35.0                        =
cyrus-sasl-2.1.26_4                =
damageproto-1.2.1                  =
db42-4.2.52_5                      =
dbus-1.6.18                        =
dbus-glib-0.100.2                  =
dconf-0.14.1                       =
dejavu-2.34_2                      =
dialog4ports-0.1.5_2               =
docbook-xsl-1.76.1_2               =
dri2proto-2.8                      =
eggdbus-0.6_1                      =
electricfence-2.2.2_2              =
encodings-1.0.4_1,1                =
expat-2.1.0                        =
fftw3-3.3.3_1                      =
fixesproto-5.0                     =
flex-2.5.38_1                      =
font-bh-ttf-1.0.3_1                =
font-misc-ethiopic-1.0.3_1         =
font-misc-meltho-1.0.3_1           =
font-util-1.3.0_1                  =
fontconfig-2.11.0_1,1              =
fontsproto-2.1.2                   =
freeglut-2.8.1                     =
freetype2-2.5.2                    =
gamin-0.1.10_6                     =
gconf2-2.32.0_3                    =
gdbm-1.11                          =
gdk-pixbuf2-2.28.2                 =
gettext-0.18.3.1                   =
ghostscript9-9.06_4                =
giflib-nox11-4.2.3_1               =
glib-1.2.10_13                     =
glib-2.36.3_2                      =
glproto-1.4.17                     =
gmake-3.82_1                       =
gmp-5.1.3                          =
gnome_subr-1.0                     =
gnomehier-3.0                      =
gobject-introspection-1.36.0_2     =
gperf-3.0.3                        =
graphite2-1.2.4                    =
gsfonts-8.11_6                     =
gtk-engines2-2.20.2_1              =
gtk-update-icon-cache-2.24.22      =
gtk2-2.24.22_1                     =
harfbuzz-0.9.25_1                  =
help2man-1.43.3_1                  =
hicolor-icon-theme-0.12            =
icu-52.1                           =
inputproto-2.3                     =
intltool-0.50.2                    =
iso8879-1986_3                     =
jasper-1.900.1_12                  =
jbig2dec-0.11_1                    =
jbigkit-1.6                        =
jpeg-8_4                           =
kbproto-1.0.6                      =
lcms2-2.5                          =
libGL-7.6.1_4                      =
libGLU-9.0.0                       =
libICE-1.0.8,1                     =
libIDL-0.8.14_1                    =
libSM-1.2.2,1                      =
libX11-1.6.2,1                     =
libXau-1.0.8                       =
libXaw-1.0.12,2                    =
libXcomposite-0.4.4,1              =
libXcursor-1.1.14                  =
libXdamage-1.1.4                   =
libXdmcp-1.1.1                     =
libXext-1.3.2,1                    =
libXfixes-5.0.1                    =
libXfont-1.4.7,1                   =
libXft-2.3.1                       =
libXi-1.7.2,1                      =
libXinerama-1.1.3,1                =
libXmu-1.1.2,1                     =
libXp-1.0.2,1                      =
libXpm-3.5.11                      =
libXrandr-1.4.2                    =
libXrender-0.9.8                   =
libXt-1.1.4,1                      =
libXxf86vm-1.1.3                   =
libcheck-0.9.12                    =
libcroco-0.6.8                     =
libdrm-2.4.17_1                    =
libexecinfo-1.1_3                  =
libffi-3.0.13_1                    =
libfontenc-1.1.2                   =
libfpx-1.3.1.4                     =
libgcrypt-1.5.3                    =
libgee-0.12.0                      =
libgpg-error-1.12                  =
libgsf-1.14.28                     =
libiconv-1.14_1                    =
libidn-1.28_1                      =
liblqr-1-0.4.1_6                   =
libltdl-2.4.2_2                    =
libmcrypt-2.5.8                    =
libpaper-1.1.24_1                  =
libpciaccess-0.13.2                =
libpthread-stubs-0.3_4             =
librsvg2-2.36.4                    =
libtool-2.4.2_2                    =
libwmf-0.2.8.4_10                  =
libxcb-1.9.3                       =
libxml2-2.8.0_3                    =
libxslt-1.1.28_1                   =
libyaml-0.1.4_3                    =
lua-5.1.5_6                        =
m4-1.4.17,1                        =
makedepend-1.0.5,1                 =
mkfontdir-1.0.7                    =
mkfontscale-1.1.1                  =
mpfr-3.1.2                         =
mysql55-client-5.5.36              =
mysql55-server-5.5.36              =
oniguruma-4.7.1                    =
p5-Authen-PAM-0.16_1               =
p5-IO-Tty-1.10                     =
p5-Locale-gettext-1.05_3           =
p5-Net-SSLeay-1.58                 =
p5-XML-Parser-2.41_1               =
pango-1.34.1_1                     =
patch-2.7.1                        =
pciids-20140206                    =
pcre-8.34                          =
pdflib-7.0.5_2                     =
pecl-APC-3.1.14_1                  =
pecl-pdflib-3.0.4                  =
perl5-5.16.3_7                     =
php5-5.4.25                        =
php5-bcmath-5.4.25                 =
php5-bz2-5.4.25                    =
php5-ctype-5.4.25                  =
php5-curl-5.4.25                   =
php5-dom-5.4.25                    =
php5-extensions-1.7                =
php5-filter-5.4.25                 =
php5-gd-5.4.25                     =
php5-hash-5.4.25                   =
php5-iconv-5.4.25                  =
php5-json-5.4.25                   =
php5-mbstring-5.4.25               =
php5-mcrypt-5.4.25                 =
php5-mysql-5.4.25                  =
php5-mysqli-5.4.25                 =
php5-openssl-5.4.25                =
php5-pcntl-5.4.25                  =
php5-pdo-5.4.25                    =
php5-pdo_sqlite-5.4.25             =
php5-phar-5.4.25                   =
php5-posix-5.4.25                  =
php5-session-5.4.25                =
php5-simplexml-5.4.25              =
php5-sockets-5.4.25                =
php5-sqlite3-5.4.25                =
php5-tokenizer-5.4.25              =
php5-xml-5.4.25                    =
php5-xmlreader-5.4.25              =
php5-xmlrpc-5.4.25                 =
php5-xmlwriter-5.4.25              =
php5-zip-5.4.25                    =
php5-zlib-5.4.25                   =
phpMyAdmin-4.1.7                   =
pixman-0.32.4                      =
pkg-1.2.6                          =
pkgconf-0.9.4                      =
png-1.5.18                         =
polkit-0.105_2                     =
portmaster-3.17.3                  =
portupgrade-2.4.12,2               =
postfix-2.11.0,1                   =
printproto-1.0.5                   =
py27-libxml2-2.8.0                 =
python-2.7_1,2                     =
python2-2_2                        =
python27-2.7.6_2                   =
randrproto-1.4.0                   =
renderproto-0.11.1                 =
ruby-1.9.3,1                       <
ruby19-bdb-0.6.6_3                 =
ruby19-date2-4.0.19                =
screen-4.0.3_14                    =
shared-mime-info-1.1               =
smartmontools-6.2_1                =
sqlite3-3.8.3.1                    =
ssmtp-2.64_1                       =
sudo-1.8.9.p5                      =
svgalib-1.4.3_6                    =
t1lib-5.1.2_2,1                    =
tcl85-8.5.15_2                     =
tiff-4.0.3                         =
unzip-6.0_1                        =
vala-0.20.1                        =
vim-7.4.182                        =
webmin-1.670                       =
webp-0.3.1_4                       =
xcb-proto-1.9                      =
xcb-util-0.3.9_1,1                 =
xcb-util-renderutil-0.3.8          =
xcmiscproto-1.2.2                  =
xextproto-7.2.1                    =
xf86bigfontproto-1.2.0             =
xf86vidmodeproto-2.3.1             =
xineramaproto-1.2.1                =
xmlcatmgr-2.2                      =
xorg-fonts-truetype-7.7_1          =
xorg-macros-1.18.0                 =
xproto-7.0.25                      =
xtrans-1.3.2                       =
zip-3.0                            =
```


----------



## SirDice (Feb 21, 2014)

I've never been a big fan of portupgrade(1), mainly because of it's dependency on Ruby. I've got nothing against Ruby but it does add another layer of complexity. You could try doing the build by hand; something like `make -C /usr/ports/lang/ruby19 clean deinstall install clean`. Once Ruby is up to date I'm sure portupgrade(1) will start behaving normally again.


----------



## Mwh65 (Feb 21, 2014)

Well that removed ruby19 but when trying to install it again, I got the same vulnerabilities error again.

I then ran portsnap fetch update which didn't list ruby19 then finally tried pkg install ruby which worked ...


```
[root@www /]# pkg install ruby
Updating repository catalogue
The following 2 packages will be installed:

        Reinstalling libexecinfo-1.1_3 (options changed)
        Installing ruby: 1.9.3.484_1,1

The installation will require 19 MB more space

3 MB to be downloaded

Proceed with installing packages [y/N]: y
libexecinfo-1.1_3.txz               100% 8792     8.6KB/s   8.6KB/s   00:00
ruby-1.9.3.484_1,1.txz              100% 3987KB   3.9MB/s   3.9MB/s   00:00
Checking integrity... done
[1/2] Reinstalling libexecinfo-1.1_3... done
[2/2] Installing ruby-1.9.3.484_1,1... done
====
Some of the standard commands are provided as separate ports for ease
of upgrading:

        devel/ruby-gems:        gem - RubyGems package manager
        devel/rubygem-rake:     rake - Ruby Make

And some of the standard libraries are provided as separate ports
since they require extra dependencies:

        converters/ruby-iconv:  iconv module
        databases/ruby-gdbm:    GDBM module
        x11-toolkits/ruby-tk:   Tcl/Tk modules
        japanese/ruby-tk:       Tcl/Tk modules for Japanized Tcl/Tk
        lang/ruby-mode.el:      Emacs lisp modules

Install them as occasion demands.
====
```

If I now run pkg version, ruby1.9.3 now shows ...


```
ruby-1.9.3.484_1,1                 >
```
Which if I'm not mistaken means the version installed is greater than what pkg knows about ??


----------



## SirDice (Feb 21, 2014)

If you have a ports tree a `pkg version` will compare versions with the ports tree. If there's no ports tree, or you use the -R switch, `pkg version` will compare against the remote repository.


----------



## Mwh65 (Feb 21, 2014)

I used pkg version -R as you mentioned and get this ...


```
Updating repository catalogue
9base-b20100604                    =
ImageMagick-6.8.0.7_5,1            =
ORBit2-2.14.19                     =
apache22-2.2.26                    =
apr-1.4.8.1.5.3                    =
atk-2.8.0                          =
autoconf-2.69                      =
autoconf-wrapper-20131203          =
automake-1.14                      =
automake-wrapper-20131203          =
bash-4.2.45_1                      =
bdftopcf-1.0.4                     =
bigreqsproto-1.1.2                 =
bison-2.7.1,1                      =
bitstream-vera-1.10_5              =
ca_root_nss-3.15.4                 =
cairo-1.10.2_7,2                   =
cmake-2.8.12.1                     =
cmake-modules-2.8.12.1_1           =
compositeproto-0.4.2               =
cscope-15.8a                       =
ctags-5.8                          =
cups-client-1.5.4_1                =
cups-image-1.5.4_1                 =
curl-7.35.0                        =
cyrus-sasl-2.1.26_4                =
damageproto-1.2.1                  =
db42-4.2.52_5                      =
dbus-1.6.18                        =
dbus-glib-0.100.2                  =
dconf-0.14.1                       =
dejavu-2.34_2                      =
dialog4ports-0.1.5_2               =
docbook-xsl-1.76.1_2               =
dri2proto-2.8                      =
eggdbus-0.6_1                      =
electricfence-2.2.2_2              =
encodings-1.0.4_1,1                =
expat-2.1.0                        =
fftw3-3.3.3_1                      =
fixesproto-5.0                     =
flex-2.5.38_2                      >
font-bh-ttf-1.0.3_1                =
font-misc-ethiopic-1.0.3_1         =
font-misc-meltho-1.0.3_1           =
font-util-1.3.0_1                  =
fontconfig-2.11.0_1,1              =
fontsproto-2.1.2                   =
freeglut-2.8.1                     =
freetype2-2.5.2                    =
gamin-0.1.10_6                     =
gconf2-2.32.0_3                    =
gdbm-1.11                          =
gdk-pixbuf2-2.28.2                 =
gettext-0.18.3.1                   =
ghostscript9-9.06_4                =
giflib-nox11-4.2.3_1               >
glib-1.2.10_13                     =
glib-2.36.3_2                      =
glproto-1.4.17                     =
gmake-3.82_1                       =
gmp-5.1.3                          =
gnome_subr-1.0                     =
gnomehier-3.0                      =
gobject-introspection-1.36.0_2     =
gperf-3.0.3                        =
graphite2-1.2.4                    =
gsfonts-8.11_6                     =
gtk-engines2-2.20.2_1              =
gtk-update-icon-cache-2.24.22      =
gtk2-2.24.22_1                     =
harfbuzz-0.9.25_1                  =
help2man-1.43.3_1                  =
hicolor-icon-theme-0.12            =
icu-52.1                           =
inputproto-2.3                     =
intltool-0.50.2                    =
iso8879-1986_3                     =
jasper-1.900.1_12                  =
jbig2dec-0.11_1                    =
jbigkit-1.6                        =
jpeg-8_4                           =
kbproto-1.0.6                      =
lcms2-2.5                          =
libGL-7.6.1_4                      =
libGLU-9.0.0                       =
libICE-1.0.8,1                     =
libIDL-0.8.14_1                    =
libSM-1.2.2,1                      =
libX11-1.6.2,1                     =
libXau-1.0.8                       =
libXaw-1.0.12,2                    =
libXcomposite-0.4.4,1              =
libXcursor-1.1.14                  =
libXdamage-1.1.4                   =
libXdmcp-1.1.1                     =
libXext-1.3.2,1                    =
libXfixes-5.0.1                    =
libXfont-1.4.7,1                   =
libXft-2.3.1                       =
libXi-1.7.2,1                      =
libXinerama-1.1.3,1                =
libXmu-1.1.2,1                     =
libXp-1.0.2,1                      =
libXpm-3.5.11                      =
libXrandr-1.4.2                    =
libXrender-0.9.8                   =
libXt-1.1.4,1                      =
libXxf86vm-1.1.3                   =
libcheck-0.9.12                    =
libcroco-0.6.8                     =
libdrm-2.4.17_1                    =
libexecinfo-1.1_3                  =
libffi-3.0.13_1                    =
libfontenc-1.1.2                   =
libfpx-1.3.1.4                     =
libgcrypt-1.5.3                    =
libgee-0.12.0                      =
libgpg-error-1.12                  =
libgsf-1.14.28                     =
libiconv-1.14_1                    =
libidn-1.28_1                      =
liblqr-1-0.4.1_6                   >
libltdl-2.4.2_2                    =
libmcrypt-2.5.8                    =
libpaper-1.1.24_1                  =
libpciaccess-0.13.2                =
libpthread-stubs-0.3_4             =
librsvg2-2.36.4                    =
libtool-2.4.2_2                    =
libwmf-0.2.8.4_10                  =
libxcb-1.9.3                       =
libxml2-2.8.0_3                    =
libxslt-1.1.28_1                   =
libyaml-0.1.4_3                    =
lua-5.1.5_6                        =
m4-1.4.17,1                        =
makedepend-1.0.5,1                 =
mkfontdir-1.0.7                    =
mkfontscale-1.1.1                  =
mpfr-3.1.2                         =
mysql55-client-5.5.36              =
mysql55-server-5.5.36              =
oniguruma-4.7.1                    =
p5-Authen-PAM-0.16_1               =
p5-IO-Tty-1.10                     =
p5-Locale-gettext-1.05_3           =
p5-Net-SSLeay-1.58                 =
p5-XML-Parser-2.41_1               =
pango-1.34.1_1                     =
patch-2.7.1                        =
pciids-20140206                    =
pcre-8.34                          =
pdflib-7.0.5_2                     ?
pecl-APC-3.1.14_1                  =
pecl-pdflib-3.0.4                  ?
perl5-5.16.3_7                     =
php5-5.4.25                        =
php5-bcmath-5.4.25                 =
php5-bz2-5.4.25                    =
php5-ctype-5.4.25                  =
php5-curl-5.4.25                   =
php5-dom-5.4.25                    =
php5-extensions-1.7                =
php5-filter-5.4.25                 =
php5-gd-5.4.25                     =
php5-hash-5.4.25                   =
php5-iconv-5.4.25                  =
php5-json-5.4.25                   =
php5-mbstring-5.4.25               =
php5-mcrypt-5.4.25                 =
php5-mysql-5.4.25                  =
php5-mysqli-5.4.25                 =
php5-openssl-5.4.25                =
php5-pcntl-5.4.25                  =
php5-pdo-5.4.25                    =
php5-pdo_sqlite-5.4.25             =
php5-phar-5.4.25                   =
php5-posix-5.4.25                  =
php5-session-5.4.25                =
php5-simplexml-5.4.25              =
php5-sockets-5.4.25                =
php5-sqlite3-5.4.25                =
php5-tokenizer-5.4.25              =
php5-xml-5.4.25                    =
php5-xmlreader-5.4.25              =
php5-xmlrpc-5.4.25                 =
php5-xmlwriter-5.4.25              =
php5-zip-5.4.25                    =
php5-zlib-5.4.25                   =
phpMyAdmin-4.1.7                   ?
pixman-0.32.4                      =
pkg-1.2.6                          =
pkgconf-0.9.4                      =
png-1.5.18                         =
polkit-0.105_2                     >
portmaster-3.17.3                  =
portupgrade-2.4.12,2               =
postfix-2.11.0,1                   =
printproto-1.0.5                   =
py27-libxml2-2.8.0                 =
python-2.7_1,2                     =
python2-2_2                        =
python27-2.7.6_2                   =
randrproto-1.4.0                   =
renderproto-0.11.1                 =
ruby-1.9.3.484_1,1                 =
ruby19-bdb-0.6.6_3                 =
ruby19-date2-4.0.19                =
screen-4.0.3_14                    =
shared-mime-info-1.1               =
smartmontools-6.2_1                =
sqlite3-3.8.3.1                    =
ssmtp-2.64_1                       =
sudo-1.8.9.p5                      =
svgalib-1.4.3_6                    =
t1lib-5.1.2_2,1                    =
tcl85-8.5.15_2                     =
tiff-4.0.3                         =
unzip-6.0_1                        =
vala-0.20.1                        =
vim-7.4.182                        =
webmin-1.670                       =
webp-0.3.1_4                       =
xcb-proto-1.9                      =
xcb-util-0.3.9_1,1                 =
xcb-util-renderutil-0.3.8          =
xcmiscproto-1.2.2                  =
xextproto-7.2.1                    =
xf86bigfontproto-1.2.0             =
xf86vidmodeproto-2.3.1             =
xineramaproto-1.2.1                =
xmlcatmgr-2.2                      =
xorg-fonts-truetype-7.7_1          =
xorg-macros-1.18.0                 =
xproto-7.0.25                      =
xtrans-1.3.2                       =
zip-3.0                            =
```
Does this mean my ports tree is out of date despite attempts to update it.


----------



## SirDice (Feb 21, 2014)

Mwh65 said:
			
		

> Does this mean my ports tree is out of date despite attempts to update it.


It certainly looks that way. You could remove /usr/ports/ and do a new, full, checkout just to be sure.


----------



## Mwh65 (Feb 21, 2014)

Same result  :q 

Not sure I can quite understand that !!


----------



## SirDice (Feb 21, 2014)

Mwh65 said:
			
		

> Not sure I can quite understand that !!


Well, that makes two of us. 

If you add the -v flag you can see what version it thinks is in the ports tree. For some ports it's normal to have a newer version (xorg-server for example) but this shouldn't be the case with Ruby. 


```
root@molly:~ # pkg version -v | grep ruby
ruby-1.9.3.484_1,1                 =   up-to-date with port
```


----------



## Mwh65 (Feb 21, 2014)

Uh oh  :OOO 


```
ruby-1.9.3.484_1,1                 >   succeeds port (port has 1.9.3_1,1)
ruby19-bdb-0.6.6_3                 =   up-to-date with port
ruby19-date2-4.0.19                =   up-to-date with port
```

Correct me if I'm wrong here but after I removed the /usr/ports directory I ran ...


```
portsnap fetch
mkdir /usr/ports
portsnap extract
```


----------



## SirDice (Feb 21, 2014)

Nope, nothing to correct, you did everything correctly. I checked your Makefile's VCS ID with mine and they're the same, the rest of the file must be the same too. Is PORTSDIR set maybe? It's also possible it may be set in pkg.conf. If it's set it may be pointing to an alternative location for the ports tree. Remove it if it's there, it should automatically default to /usr/ports/.


----------



## Mwh65 (Feb 21, 2014)

Running pkg -vv gives the following ...


```
Version                 : 1.2.6
PACKAGESITE             : 
PKG_DBDIR               : /var/db/pkg
PKG_CACHEDIR            : /var/cache/pkg
PORTSDIR                : /usr/ports
PUBKEY                  : 
HANDLE_RC_SCRIPTS       : no
ASSUME_ALWAYS_YES       : no
REPOS_DIR               : [
  /etc/pkg/,
  /usr/local/etc/pkg/repos/,
]
PLIST_KEYWORDS_DIR      : 
SYSLOG                  : yes
AUTODEPS                : yes
ABI                     : freebsd:9:x86:32
DEVELOPER_MODE          : no
PORTAUDIT_SITE          : http://portaudit.FreeBSD.org/auditfile.tbz
VULNXML_SITE            : http://www.vuxml.org/freebsd/vuln.xml.bz2
MIRROR_TYPE             : SRV
FETCH_RETRY             : 3
PKG_PLUGINS_DIR         : /usr/local/lib/pkg/
PKG_ENABLE_PLUGINS      : yes
PLUGINS                 : [
]
DEBUG_SCRIPTS           : no
PLUGINS_CONF_DIR        : /usr/local/etc/pkg/
PERMISSIVE              : no
REPO_AUTOUPDATE         : yes
NAMESERVER              : 
EVENT_PIPE              : 
FETCH_TIMEOUT           : 30
UNSET_TIMESTAMP         : no
SSH_RESTRICT_DIR        : 
PKG_SSH_ARGS            : 
PKG_ENV                 : {
}
DISABLE_MTREE           : no
DEBUG_LEVEL             : 0
ALIAS                   : {
  all-depends: query %dn-%dv,
  annotations: info -A,
  build-depends: info -qd,
  download: fetch,
  iinfo: info -i -g -x,
  isearch: search -i -g -x,
  leaf: query -e "%a == 0" "%n-%v",
  list: info -ql,
  origin: info -qo,
  provided-depends: info -qb,
  raw: info -R,
  required-depends: info -qr,
  shared-depends: info -qB,
  show: info -f -k,
  size: info -sq,
}

Repositories:
  FreeBSD: { 
    url             : "pkg+http://pkg.FreeBSD.org/freebsd:9:x86:32/latest",
    enabled         : yes,
    mirror_type     : "SRV"
  }
```

where PORTSDIR is set  (as a default maybe) and the contents of pkg.conf...


```
# System-wide configuration file for pkg(8)
# For more information on the file format and
# options please refer to the pkg.conf(5) man page

# Configuration options
#PKG_DBDIR            : /var/db/pkg
#PKG_CACHEDIR            : /var/cache/pkg
#PORTSDIR            : /usr/ports
#HANDLE_RC_SCRIPTS  : NO
#ASSUME_ALWAYS_YES  : NO
#SYSLOG                    : YES
#SHLIBS                    : NO
#AUTODEPS            : NO
#PORTAUDIT_SITE            : http://portaudit.FreeBSD.org/auditfile.tbz
#PKG_PLUGINS_DIR    : /usr/local/lib/pkg/plugins
#PKG_ENABLE_PLUGINS : YES
#PLUGINS            : [commands/mystat]
#REPO_AUTOUPDATE    : YES
ALIAS              : {
  all-depends: query %dn-%dv,
  annotations: info -A,
  build-depends: info -qd,
  download: fetch,
  iinfo: info -i -g -x,
  isearch: search -i -g -x,
  leaf: query -e "%a == 0" "%n-%v",
  leaf: query -e "%a == 0" "%n-%v",
  list: info -ql,
  origin: info -qo,
  provided-depends: info -qb,
  raw: info -R,
  required-depends: info -qr,
  shared-depends: info -qB,
  show: info -f -k,
  size: info -sq,
  }
```


----------



## Mwh65 (Feb 25, 2014)

The weirdness continues. The daily cron job /usr/sbin/pkg version -v -L '=' lists the following port has a newer version ...


```
ruby-1.9.3.484_1,1                 >   succeeds port (port has 1.9.3_1,1)
```

which we know isn't the case. However portupgrade makes no attempt whatsoever to update it.

Exactly what is reporting ruby has a different version ?


----------



## kpa (Feb 25, 2014)

Just to make sure the ports tree is really used for the check, delete /usr/ports/INDEX-* files and run the check again.

Also, do you happen to have a PORTSDIR setting in your /etc/make.conf? (The same setting in pkg's configuration has no effect on ports building).


----------



## Mwh65 (Feb 25, 2014)

This is the contents of /etc/make.conf


```
RUBY_VERSION=1.9.3
DEFAULT_VERSIONS= ruby=1.9
WITH_PKGNG=yes
```

I deleted 4 INDEX-* files and run the check again.

A new file called INDEX-9 has appeared and on checking its content I found ruby-1.9.3.484_1,1 which is the correct current version.

I then ran /usr/sbin/pkg version -v -L '=' to check which again returned ...


```
ruby-1.9.3.484_1,1                 >   succeeds port (port has 1.9.3_1,1)
```

which to me would mean it isn't looking at the correct INDEX file !!


----------



## SirDice (Feb 26, 2014)

A `pkg version -v` doesn't look at the INDEX file, it looks at each port individually. A `pkg version -vI` does use INDEX.  I'm still baffled why your ports seem to still insist on 1.9.3_1,1  :q


----------



## Mwh65 (Feb 26, 2014)

Yup sure enough issuing `pkg version -vI` does indeed tell me ruby is up to date.  :q  :q 

Surely removing and rebuilding the /usr/ports/ directory should have resolved this.

What I have found in /var/db/pkg are a lot of folders relating to the installed ports, however the folder names are showing older versions eg I know the PHP version on my server is 5.4.25 and one of the folder names is php5-session-5.4.21. Are they from the original port updating method ?


----------



## SirDice (Feb 26, 2014)

Mwh65 said:
			
		

> What I have found in /var/db/pkg are a lot of folders relating to the installed ports, however the folder names are showing older versions eg I know the PHP version on my server is 5.4.25 and one of the folder names is php5-session-5.4.21. Are they from the original port updating method ?


They're left-overs from the old packaging system. For each subdirectory check with pkg-info(8) if it's registered properly with the new system. If it has you can remove that directory. Don't remove the local.sqlite file though, it's the new package system database that contains all the registrations of the things you installed. Removing it would make the system think there's nothing installed any more.


----------



## Mwh65 (Mar 9, 2014)

Well I took the  plunge and ran the following ...


```
# pkg set -o lang/ruby19:lang/ruby21
  # pkg install -fR lang/ruby21
```

and now /usr/sbin/pkg version -v -L '=' returns no output even though ruby-1.9.3.484_1,1 is still installed but noted it got re-installed when the above commands were run.

I have also noticed the etc/make.conf file contains this now ...


```
DEFAULT_VERSIONS= ruby=2.1 php=5.4
WITH_PKGNG=yes
```
Is the RUBY_VERSION= still needed as it has been removed.


----------

