Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Sep 2015 00:49:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 203429] Could rbenv / rvm conflict with ruby gem building?
Message-ID:  <bug-203429-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203429

            Bug ID: 203429
           Summary: Could rbenv / rvm conflict with ruby gem building?
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: tony@git-pull.com
                CC: freebsd-ports-bugs@FreeBSD.org

Created attachment 161510
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=161510&action=edit
ruby-build output (tree)

(In reply to Michael Moll from bug #202999, comment #4)

Could rbenv or rvm's shell sourcing scripts interact with building gems?

I would assume that bsd.ruby.mk would workaround that. I haven't tracked down a
prior dialog on this.

This problem could be difficult to diagnose unless the bug submitter detailed
they were using this tool.

bsd.ruby.mk seems to look for ruby (as a last resort) in /usr/local/bin/ruby.

In the case of the parent topic, ruby-build (a tool used in unison with rbenv)
does two things:

1. Can build ruby by itself, `ruby-build 2.2.2 /usr/local` could overwrite
ruby. It would be like building ruby from outside the port and installing it
there.

For kicks, I attached what a `ruby-build 2.2.2 ~/ruby` would output. See
attachment for output tree.

>From this, it looks like it would trash the ruby installed from the system.
`pkg-check(8)` would probably go off.

2. It is used by rbenv (giving the rbenv install command) and installs the ruby
to ~/.rbenv.

As for environmental variables from rbenv/rvm mangling into port building - I
would assume no unless we see issues otherwise.  If ruby gems are getting odd
build errors that defy explanation - asking them if they use rbenv/rvm may be
pertinent.

To give it a shot, I gave devel/rubygem-ffi a try in rbenv:

tony at z600 in ~ 
$ cd /usr/ports/devel/rubygem-ffi

tony at z600 in /usr/ports/devel/rubygem-ffi 
$ ls
Makefile  distinfo  pkg-descr

tony at z600 in /usr/ports/devel/rubygem-ffi 
$ rbenv which ruby
/usr/home/tony/.rbenv/versions/2.2.2/bin/ruby

tony at z600 in /usr/ports/devel/rubygem-ffi 
$ ruby --version  
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-freebsd11.0]

tony at z600 in /usr/ports/devel/rubygem-ffi 
$ make config
===> No options to configure

$ sudo make

RubyGems installed the following executables:
    /usr/ports/devel/ruby-gems/work/stage/usr/local/bin/gem21

Ruby Interactive (ri) documentation was installed. ri is kind of like man 
pages for ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.

====> Compressing man pages (compress-man)
===>  Installing for ruby21-gems-2.4.8
===>  Checking if ruby21-gems already installed
===>   Registering installation for ruby21-gems-2.4.8 as automatic
Installing ruby21-gems-2.4.8...
===>   rubygem-ffi-1.9.10 depends on file: /usr/local/bin/gem21 - found
===>   Returning to build of rubygem-ffi-1.9.10
===>   rubygem-ffi-1.9.10 depends on file: /usr/local/bin/ruby21 - found
Unpacked gem: '/usr/ports/devel/rubygem-ffi/work/ffi-1.9.10'
===>  Patching for rubygem-ffi-1.9.10
===>   rubygem-ffi-1.9.10 depends on file: /usr/local/bin/ruby21 - found
===>   rubygem-ffi-1.9.10 depends on file: /usr/local/bin/gem21 - found
===>   rubygem-ffi-1.9.10 depends on file: /usr/local/bin/ruby21 - found
===>   rubygem-ffi-1.9.10 depends on shared library: libffi.so - found
(/usr/local/lib/libffi.so)
===>  Configuring for rubygem-ffi-1.9.10
===>   FreeBSD 10 autotools fix applied to
/usr/ports/devel/rubygem-ffi/work/ffi-1.9.10/ext/ffi_c/libffi/m4/libtool.m4
===>   FreeBSD 10 autotools fix applied to
/usr/ports/devel/rubygem-ffi/work/ffi-1.9.10/ext/ffi_c/libffi/configure
===>  Building for rubygem-ffi-1.9.10
  Successfully built RubyGem
  Name: ffi
  Version: 1.9.10
  File: ffi-1.9.10.gem
===>  Staging for rubygem-ffi-1.9.10
===>   rubygem-ffi-1.9.10 depends on file: /usr/local/bin/gem21 - found
===>   rubygem-ffi-1.9.10 depends on file: /usr/local/bin/ruby21 - found
===>   Generating temporary packing list
(cd /usr/ports/devel/rubygem-ffi/work/ffi-1.9.10; /usr/bin/env LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 RB_USER_INSTALL=yes
/usr/local/bin/gem21 install -l --no-update-sources --install-dir
/usr/ports/devel/rubygem-ffi/work/stage/usr/local/lib/ruby/gems/2.1
--ignore-dependencies
--bindir=/usr/ports/devel/rubygem-ffi/work/stage/usr/local/bin --rdoc --ri
ffi-1.9.10.gem -- --build-args )
Building native extensions with: '--build-args'
This could take a while...
Successfully installed ffi-1.9.10
Parsing documentation for ffi-1.9.10
Installing ri documentation for ffi-1.9.10
Installing darkfish documentation for ffi-1.9.10
Done installing documentation for ffi after 2 seconds
1 gem installed
/bin/rm -f -r
/usr/ports/devel/rubygem-ffi/work/stage/usr/local/lib/ruby/gems/2.1/build_info/
/bin/rmdir
/usr/ports/devel/rubygem-ffi/work/stage/usr/local/lib/ruby/gems/2.1/extensions
2> /dev/null || true
====> Compressing man pages (compress-man)

-- 
You are receiving this mail because:
You are on the CC list for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-203429-13>