Giter Site home page Giter Site logo

rbenv / ruby-build Goto Github PK

View Code? Open in Web Editor NEW
3.9K 104.0 780.0 3.18 MB

A tool to download, compile, and install Ruby on Unix-like systems.

Home Page: https://rbenv.org/man/ruby-build.1

License: MIT License

Shell 67.69% Roff 31.82% Ruby 0.32% Makefile 0.16%
hacktoberfest ruby rbenv-plugin version-manager

ruby-build's Introduction

ruby-build

ruby-build is a command-line tool that simplifies installation of any Ruby version from source on Unix-like systems.

It is available as a plugin for rbenv as the rbenv install command, or as a standalone program as the ruby-build command.

Installation

Homebrew package manager

brew install ruby-build

Upgrade with:

brew upgrade ruby-build

Clone as rbenv plugin using git

git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

Upgrade with:

git -C "$(rbenv root)"/plugins/ruby-build pull

Install manually as a standalone program

First, download a tarball from https://github.com/rbenv/ruby-build/releases/latest. Then:

tar -xzf ruby-build-*.tar.gz
PREFIX=/usr/local ./ruby-build-*/install.sh

Usage

Basic Usage

# As a standalone program
$ ruby-build --list                        # lists available versions of Ruby
$ ruby-build 3.2.2 /opt/rubies/ruby-3.2.2  # installs Ruby 3.2.2

# As an rbenv plugin
$ rbenv install 3.2.2  # installs Ruby 3.2.2 to ~/.rbenv/versions/3.2.2

Warning

ruby-build mostly does not verify that system dependencies are present before downloading and attempting to compile Ruby from source. Please ensure that all requisite libraries such as build tools and development headers are already present on your system.

Basically, what ruby-build does when installing a Ruby version is this:

  • Downloads an official tarball of Ruby source code;
  • Extracts the archive into a temporary directory on your system;
  • Executes ./configure --prefix=/path/to/destination in the source code;
  • Runs make install to compile Ruby;
  • Verifies that the installed Ruby is functional.

Depending on the context, ruby-build does a little bit more than the above: for example, it will try to link Ruby to the appropriate OpenSSL version, even if that means downloading and compiling OpenSSL itself; it will discover and link to Homebrew-installed instances of some libraries like libyaml and readline, etc.

Advanced Usage

Custom Build Definitions

To install a version of Ruby that is not recognized by ruby-build, you can specify the path to a custom build definition file in place of a Ruby version number.

Check out default build definitions as examples on how to write definition files.

Custom Build Configuration

The build process may be configured through the following environment variables:

Variable Function
TMPDIR Where temporary files are stored.
RUBY_BUILD_BUILD_PATH Where sources are downloaded and built. (Default: a timestamped subdirectory of TMPDIR)
RUBY_BUILD_CACHE_PATH Where to cache downloaded package files. (Default: ~/.rbenv/cache if invoked as rbenv plugin)
RUBY_BUILD_HTTP_CLIENT One of aria2c, curl, or wget to use for downloading. (Default: first one found in PATH)
RUBY_BUILD_ARIA2_OPTS Additional options to pass to aria2c for downloading.
RUBY_BUILD_CURL_OPTS Additional options to pass to curl for downloading.
RUBY_BUILD_WGET_OPTS Additional options to pass to wget for downloading.
RUBY_BUILD_MIRROR_URL Custom mirror URL root.
RUBY_BUILD_MIRROR_PACKAGE_URL Custom complete mirror URL (e.g. http://mirror.example.com/package-1.0.0.tar.gz).
RUBY_BUILD_SKIP_MIRROR Bypass the download mirror and fetch all package files from their original URLs.
RUBY_BUILD_TARBALL_OVERRIDE Override the URL to fetch the ruby tarball from, optionally followed by #checksum.
RUBY_BUILD_DEFINITIONS Colon-separated list of paths to search for build definition files.
RUBY_BUILD_ROOT The path prefix to search for build definitions files. Deprecated: use RUBY_BUILD_DEFINITIONS
CC Path to the C compiler.
RUBY_CFLAGS Additional CFLAGS options (e.g., to override -O3).
CONFIGURE_OPTS Additional ./configure options.
MAKE Custom make command (e.g., gmake).
MAKE_OPTS / MAKEOPTS Additional make options.
MAKE_INSTALL_OPTS Additional make install options.
RUBY_CONFIGURE_OPTS Additional ./configure options (applies only to Ruby source).
RUBY_MAKE_OPTS Additional make options (applies only to Ruby source).
RUBY_MAKE_INSTALL_OPTS Additional make install options (applies only to Ruby source).
NO_COLOR Disable ANSI colors in output. The default is to use colors for output connected to a terminal.
CLICOLOR_FORCE Use ANSI colors in output even when not connected to a terminal.

Applying Patches

Both rbenv install and ruby-build commands support the -p/--patch flag to apply a patch to the Ruby source code before building. Patches are read from standard input:

# applying a single patch
$ rbenv install --patch 1.9.3-p429 < /path/to/ruby.patch

# applying a patch from HTTP
$ rbenv install --patch 1.9.3-p429 < <(curl -sSL http://git.io/ruby.patch)

# applying multiple patches
$ cat fix1.patch fix2.patch | rbenv install --patch 1.9.3-p429

Checksum Verification

All Ruby definition files bundled with ruby-build include checksums for packages, meaning that all externally downloaded packages are automatically checked for integrity after fetching.

See the next section for more information on how to author checksums.

Package Mirrors

To speed up downloads, ruby-build fetches package files from a mirror hosted on Amazon CloudFront. To benefit from this, the packages must specify their checksum:

# example:
install_package "ruby-2.6.5" "https://ruby-lang.org/ruby-2.6.5.tgz#<SHA2>"

ruby-build will first try to fetch this package from $RUBY_BUILD_MIRROR_URL/<SHA2> (note: this is the complete URL), where <SHA2> is the checksum for the file. It will fall back to downloading the package from the original location if:

  • the package was not found on the mirror;
  • the mirror is down;
  • the download is corrupt, i.e. the file's checksum doesn't match;
  • no tool is available to calculate the checksum; or
  • RUBY_BUILD_SKIP_MIRROR is enabled.

You may specify a custom mirror by setting RUBY_BUILD_MIRROR_URL.

If a mirror site doesn't conform to the above URL format, you can specify the complete URL by setting RUBY_BUILD_MIRROR_PACKAGE_URL. It behaves the same as RUBY_BUILD_MIRROR_URL except being a complete URL.

The default ruby-build download mirror is sponsored by Basecamp.

Keeping the build directory after installation

Both ruby-build and rbenv install accept the -k or --keep flag, which tells ruby-build to keep the downloaded source after installation. This can be useful if you need to use gdb and memprof with Ruby.

Source code will be kept in a parallel directory tree ~/.rbenv/sources when using --keep with the rbenv install command. You should specify the location of the source code with the RUBY_BUILD_BUILD_PATH environment variable when using --keep with ruby-build.

Getting Help

Please see the ruby-build wiki for solutions to common problems.

If you can't find an answer on the wiki, open an issue on the issue tracker. Be sure to include the full build log for build failures.

ruby-build's People

Contributors

bensie avatar byroot avatar chrisseaton avatar deepj avatar dependabot[bot] avatar eregon avatar eric avatar guilleiguaran avatar headius avatar hsbt avatar jas14 avatar jasonkarns avatar jc00ke avatar jeremy avatar jnozsc avatar josh avatar koic avatar metalefty avatar mislav avatar msp-greg avatar nirvdrum avatar noahgibbs avatar raggi avatar reedloden avatar sferik avatar sorah avatar sstephenson avatar toy avatar yuichiro-naito avatar yyuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby-build's Issues

Ruby-build not detecting gcc

Installed rbenv and ruby-build today and when I try and install a Ruby I get an error that a suitable gcc binary couldn't be found.

~ $ rbenv install 1.9.2-p290

ERROR: This package must be compiled with GCC, and we
couldn't find a suitable `gcc' binary on your system.
Please install GCC and try again.

You can install these GCC packages on Mac OS X:
https://github.com/kennethreitz/osx-gcc-installer/downloads


BUILD FAILED

Inspect or clean up the working tree at /var/folders/df/2c1r37kd52l_5t54bb25xwt80000gn/T/ruby-build.20111023123010.330

 ~ $ which gcc
/usr/bin/gcc

 ~ $ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files

 ~ $ ruby-build
ruby-build 20110928
usage: ruby-build [-v|--verbose] definition prefix
       ruby-build --definitions

Build ruby with shared library

I'm not sure whether there is a good reason for this, but ruby-build does not build a ruby shared library.

This caused an issue for me when trying to build the zookeeper gem (ruby 1.9.2-p290), which fails to compile.

I solved the issue by recompiling ruby with

./configure --prefix=$HOME/.rbenv/versions/1.9.2-p290 --enable-shared

RVM appears to do this by default - can ruby-build do the same?

Thanks!

Allow Patching Hook?

On some machines (like mine), ruby 1.8.7 won't compile, but there is a patch: http://redmine.ruby-lang.org/issues/5108

I imagine there would be other reasons you might want to patch ruby as you installed it. I would probably figure out how to write a definition that would replicate what I just did by hand for my specific patch. Would people rather see that pull request, or do folks think it would be useful to have some way to tell ruby-build to apply some patch file before building whatever version of ruby?

Support Patches

I may find some time in a bit to try and submit a patch, but I thought it would be cool just to open a ticket and talk around this. It would be awesome if ruby-build allowed you to pass a patch argument. I have been using this for Ruby 1.9.3.preview1 since it allows you to GC tune like REE but for some reason echo's the hell out of your setting all over the place.

https://gist.github.com/1124322

Applying patches is not necessarily a big deal, but in my view, using 1.9.3 with GC turning without that patch drives me batty. If you can provide directions on how you might like to see a patch for patch :) I would be willing to try.

Depend on reliable 3rd party sites (not pyyaml.org)

Hello,

pyyaml.org has been down for a while now and this prevents use of ruby-build.

I'd suggest depending only on reliable 3rd party sites to deliver dependencies. Maybe some GitHub mirror like https://github.com/yaml/libyaml (although this one is probably outdated).

Here's what ruby-build prints:

Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...

BUILD FAILED

Inspect or clean up the working tree at /tmp/ruby-build.20111207111740.8294
Results logged to /tmp/ruby-build.20111207111740.8294.log

Last 10 log lines:
/tmp/ruby-build.20111207111740.8294 ~
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:04:24 --:--:--     0
curl: (56) Recv failure: Connection reset by peer

REE is installed with wrong/no readline

for REE, when I paste into irb or pry, the characters come in very slowly. it's the problem described here:

I'm working on a ruby-build solution for this now (although I'm not exactly sure what that is -- the discussions at those questions and elsewhere on the web is never quite clear about what the cause is -- a particular version of readline? I'm going to look at the RVM solution)

Is it worth fixing at the ruby-build level? Have others experience this problem? I'm on 10.6.8

Tk

I'm trying to install the Tk bindings for Ruby. According to the instructions building Ruby would need to be:

% ./configure --prefix=<install-dir>
  --with-tcl-dir=/opt/ActiveTcl-8.5
  --with-tk-dir=/opt/ActiveTcl-8.5
  --with-tcllib=tclstub8.5 
  --with-tklib=tkstub8.5
  --enable-tcltk_stubs
  --enable-tcl-thread
  --enable-pthread
% make && make install

How can configure ruby-build to use these configure options?

PREFIX_PATH broken w/ jruby-1.6.4

Installed with:

➜  ~  ruby-build jruby-1.6.4 ~/.rbenv/versions/jruby-1.6.4 
Downloading http://jruby.org.s3.amazonaws.com/downloads/1.6.4/jruby-bin-1.6.4.tar.gz...
Installing jruby-1.6.4...
Installed jruby-1.6.4 to /Users/justin/.rbenv/versions
Downloading http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz...
Installing rubygems-1.6.2...
Installed rubygems-1.6.2 to /Users/justin/.rbenv/versions
➜  ~  

The dir is emtpy:

➜  ~  ls -al .rbenv/versions/jruby-1.6.4 
total 0
drwxr-xr-x  2 justin  justin   68 Sep  6 16:29 .
drwxr-xr-x  8 justin  justin  272 Sep  6 16:54 ..

Looks like it's installing it into the ~/.rbenv/versions dir itself :-(

➜  ~  ls -al .rbenv/versions/           
total 0
drwxr-xr-x   8 justin  justin  272 Sep  6 16:54 .
drwxr-xr-x  13 justin  justin  442 Sep  6 16:51 ..
drwxr-xr-x   5 justin  justin  170 Aug 15 14:20 1.8.4
drwxr-xr-x   5 justin  justin  170 Aug 16 08:44 1.8.7-p352
drwxr-xr-x   6 justin  justin  204 Aug 15 13:52 1.9.2-p290
drwxr-xr-x  11 justin  justin  374 Aug 15 13:51 jruby-1.6.3
drwxr-xr-x   2 justin  justin   68 Sep  6 16:29 jruby-1.6.4
drwxr-xr-x  11 justin  justin  374 Aug 19 11:12 rbx-1.2.4
➜  ~  

ruby-build 20110906

1.9.2 on lion

is there a reason why the 1.9.2 recipe does not include "use_gcc42_on_lion" ?
I had to add it or else I got crash every time I executed a ruby application if compiled with llvm.

1.9.3 can't find SHA on Lion?

Anyone else seeing this?

I'm getting this issue with my brand new 1.9.3 build:

~/.rbenv/shims/bundle help

$HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': dlopen($HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle, 9): Symbol not found: _rb_Digest_SHA1_Finish (LoadError) Referenced from: $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle Expected in: flat namespace in $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle - $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/definition.rb:1:in <top (required)>' from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:136:indefinition'
from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/cli.rb:220:in install' from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:inrun'
from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:indispatch'
from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in start' from $HOME/.rbenv/versions/1.9.3-preview1/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/bin/bundle:13:in<top (required)>'
from $HOME/.rbenv/versions/1.9.3-preview1/bin/bundle:19:in load' from $HOME/.rbenv/versions/1.9.3-preview1/bin/bundle:19:in

'

use_gcc42_on_lion causes error on Snow Leopard

The use_gcc42_on_lion target raises a "BUILD FAILED" message on OSX 10.6.8 (Snow Leopard), but the Ruby / REE 1.8 build continues and succeeds just fine.

It's due to "set -E" and the second "if" statement in the use_gcc42_on_lion function, but I'm not really sure how to fix it short of just "set +E" in the function.

install rubinius from local sources

Hi,
What I wanted was an install recipe installing from my local copy instead of the remote, can anyone help me with this ?
I tried to write it but failed :(

Submit to Homebrew

We told the homebrew guys to hold off until we did a proper tagged release.

Keep ruby source around for further tinkering

I was sad to see my the source directory for my newly built ruby be wiped away as soon as rb-env completed. I wanted to go in and rebuild readline, since it failed to do so by default.

I really was a fan of how rvm kept the source for rubies around in ~/.rvm/src. Not sure if most people will find it helpful or not... maybe I am a minority case.

1.8.6-p420 build failed on Ubuntu 10.4 Lucid Lynx

$ rbenv install 1.8.6-p420 
Downloading http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p420.tar.gz...
Installing ruby-1.8.6-p420...

BUILD FAILED

Inspect or clean up the working tree at /tmp/ruby-build.20111107212352.8310
Results logged to /tmp/ruby-build.20111107212352.8310.log

Last 10 log lines:
/usr/bin/gcc -g -O2  -DRUBY_EXPORT -D_GNU_SOURCE=1  -L. -L'/home/ingmar/.rbenv/versions/1.8.6-p420/lib'  -rdynamic -Wl,-export-dynamic   main.o  libruby-static.a -lrt -ldl -lcrypt -lm   -o miniruby
rbconfig.rb updated
compiling Win32API
compiling bigdecimal
make[1]: Entering directory `/tmp/ruby-build.20111107212352.8310/ruby-1.8.6-p420/ext/bigdecimal'
mkdir -p ../../.ext/i686-linux
make[1]: *** read jobs pipe: No such file or directory.  Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/tmp/ruby-build.20111107212352.8310/ruby-1.8.6-p420/ext/bigdecimal'
make: *** [all] Error 1

It's been suggested that this is a bug in the Ruby Makefiles, but all I know is that omitting '-j 2' from the make call solves the problem for me.

Command to update defintions

It would be nice to have a command to update definitions. Something like:

ruby-build definitions update

At this moment to have this behavior we usually have to run.

cd ~/Sources/ruby-build
git pull
./install.sh

Installing jruby-1.6.4

I cannot install jruby-1.6.4 using rbenv. I can install other Rubies (e.g. 1.9.2-p290). I am using Mac OS X 10.7.

~ $ echo $PATH
/Users/harrigan/.rbenv/shims:/Users/harrigan/.rbenv/bin:/Users/harrigan/bin:/Users/harrigan/.gem/ruby/1.9.1/bin:/usr/local/bin:/usr/local/lib/ruby/gems/1.9.1:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin
~ $ ruby-build --definitions
1.8.6-p420
1.8.7-p249
1.8.7-p352
1.9.1-p378
1.9.2-p290
1.9.3-preview1
jruby-1.6.3
jruby-1.6.4
rbx-1.2.4
ree-1.8.7-2011.03
~ $ ruby-build jruby-1.6.4 ~/.rbenv/versions/jruby-1.6.4
Downloading http://jruby.org.s3.amazonaws.com/downloads/1.6.4/jruby-bin-1.6.4.tar.gz...
Installing jruby-1.6.4...
sed: can't read s/^#!\/bin\/bash/#!\/usr\/bin\/env bash/: No such file or directory

BUILD FAILED

Inspect or clean up the working tree at /var/folders/n0/z80bfnt150z6lk0x20s81_r80000gn/T/ruby-build.20110907172953.18163
Results logged to /var/folders/n0/z80bfnt150z6lk0x20s81_r80000gn/T/ruby-build.20110907172953.18163.log

Binary packages

I'd like to add binary package support to ruby-build. I'd guess that most ruby-build installations are on one of two platforms—Mac OS X x86_64 or Linux x86_64—and most people really don't need to compile their own Ruby runtimes. Binary packages would make it much quicker to get up and running.

In order to do this, we'll need a command to build a definition into a temporary directory and make a tarball. We'll also need a way to download and install package tarballs from the internet. This implies having package repository sources, an architecture naming system, and an index of packages with checksums.

Build failed when installing REE as it complains about OpenSSL

Cross posted from rbenv/rbenv#132.

@josh recommends that I pass in some config options, however I'm unsure as what I should be passing in.

I'm running Ubuntu 11.10 and can't install ree-1.8.7-2011.03, though installing 1.8.7-p352 worked fine. OpenSSL is installed. See below a snippet of the log from the build failure. I can't figure out as to why this is happening?

ossl_x509name.c: In function ‘ossl_x509name_initialize’:
ossl_x509name.c:143:35: warning: passing argument 2 of ‘d2i_X509_NAME’ from incompatible pointer type [enabled by default]
/usr/include/openssl/x509.h:828:1: note: expected ‘const unsigned char ’ but argument is of type ‘unsigned char *
/usr/bin/gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H="extconf.h" -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -fPIC -g -O2 -c ossl_x509crl.c
/usr/bin/gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H="extconf.h" -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -fPIC -g -O2 -c ossl.c
/usr/bin/gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H="extconf.h" -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -fPIC -g -O2 -c ossl_pkcs12.c
/usr/bin/gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H="extconf.h" -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -I'/home/damian/.rbenv/versions/ree-1.8.7-2011.03/include' -fPIC -g -O2 -c ossl_ssl.c
ossl_ssl.c:101:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:101:5: warning: (near initialization for ‘ossl_ssl_method_tab[0].func’) [enabled by default]
ossl_ssl.c:102:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:102:5: warning: (near initialization for ‘ossl_ssl_method_tab[1].func’) [enabled by default]
ossl_ssl.c:103:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:103:5: warning: (near initialization for ‘ossl_ssl_method_tab[2].func’) [enabled by default]
ossl_ssl.c:104:1: error: ‘SSLv2_method’ undeclared here (not in a function)
ossl_ssl.c:105:1: error: ‘SSLv2_server_method’ undeclared here (not in a function)
ossl_ssl.c:106:1: error: ‘SSLv2_client_method’ undeclared here (not in a function)
ossl_ssl.c:107:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:107:5: warning: (near initialization for ‘ossl_ssl_method_tab[6].func’) [enabled by default]
ossl_ssl.c:108:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:108:5: warning: (near initialization for ‘ossl_ssl_method_tab[7].func’) [enabled by default]
ossl_ssl.c:109:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:109:5: warning: (near initialization for ‘ossl_ssl_method_tab[8].func’) [enabled by default]
ossl_ssl.c:110:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:110:5: warning: (near initialization for ‘ossl_ssl_method_tab[9].func’) [enabled by default]
ossl_ssl.c:111:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:111:5: warning: (near initialization for ‘ossl_ssl_method_tab[10].func’) [enabled by default]
ossl_ssl.c:112:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:112:5: warning: (near initialization for ‘ossl_ssl_method_tab[11].func’) [enabled by default]
ossl_ssl.c: In function ‘ossl_ssl_get_cipher’:
ossl_ssl.c:1224:12: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
make[1]: ** [ossl_ssl.o] Error 1
make[1]: Leaving directory `/tmp/ruby-build.20111028140052.26318/ruby-enterprise-1.8.7-2011.03/source/ext/openssl'
make: *** [all] Error 1

Keep the sources cached

Hello,

I tried ruby-build along with rbenv and I like it but I think it would be even better if it was able to cache the source code of a ruby version.

For instance, today I rebuilt my Ruby 1.9.3 many times (the first time, the second time since I din't have zlib, the third time since I didn't have openssl compilation option) and the download step is quite long and useless. I would be glad to have some cache directory in .rbenv to shorten this step.

What do you think about that? Can I help?

Try Install ree-1.8.7-2011.03 and 1.9.3.-rc1 - BUILD FAILED

~ $ rbenv install ree-1.8.7-2011.03
Downloading http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz...
Installing ruby-enterprise-1.8.7-2011.03...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/v1/wfk93jv14q1_9hxlhs4f0qfh0000gn/T/ruby-build.20111021133605.1745
Results logged to /var/folders/v1/wfk93jv14q1_9hxlhs4f0qfh0000gn/T/ruby-build.20111021133605.1745.log

and 1.9.3-rc1 is same case

definition for jruby-1.6.3 sed command

Hi,

I'm using rbenv and ruby-build on my mac and it works great, many thanks for releasing this. I tried to use it on my ubuntu box at work and the sed command:

sed -i "" 's/^#!/bin/bash/#!/usr/bin/env bash/' jruby

barfs due to the empty string args for edit in place. This works fine:

sed -i 's/^#!/bin/bash/#!/usr/bin/env bash/' jruby

however, i imagine that does not work for mac. Just thought I would let you know... I guess there could be separate definitions for linux but this seems like a shame. I just edited it by hand as it is a one-off install for me...

Thanks,
gaz

1.9.3-rc1 installation failed on RHEL

I just pulled the latest repo changes, ran sudo ./install.sh, and then rbenv install 1.9.3-rc1. Although this worked for me on my OS X laptop, it failed on my RHEL server.

The last few lines of the log are:

installing default zlib libraries
linking shared-object zlib.so
make[2]: Leaving directory `/tmp/ruby-build.20111020064043.2396/ruby-1.9.3-rc1/ext/zlib'
make[2]: Entering directory `/tmp/ruby-build.20111020064043.2396/ruby-1.9.3-rc1'
linking ruby
make[2]: Leaving directory `/tmp/ruby-build.20111020064043.2396/ruby-1.9.3-rc1'
make[1]: Leaving directory `/tmp/ruby-build.20111020064043.2396/ruby-1.9.3-rc1'
Generating RDoc documentation
./ruby: symbol lookup error: /tmp/ruby-build.20111020064043.2396/ruby-1.9.3-rc1/.ext/i686-linux/enc/encdb.so: undefined symbol: rb_encdb_declare
make: *** [rdoc] Error 127

And my server's details:

$ uname -a
Linux my.host.name 2.6.18-53.1.6.el5xen #1 SMP Wed Jan 23 12:33:37 EST 2008 i686 athlon i386 GNU/Linux

How can I get this working please?

ree-1.8.7-2011.03 fails to build with openssl 1.0.0

rbenv install ree-1.8.7-2011.03

ossl_ssl.c:101:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:101:5: warning: (near initialization for 'ossl_ssl_method_tab[0].func') [enabled by default]
ossl_ssl.c:102:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:102:5: warning: (near initialization for 'ossl_ssl_method_tab[1].func') [enabled by default]
ossl_ssl.c:103:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:103:5: warning: (near initialization for 'ossl_ssl_method_tab[2].func') [enabled by default]
ossl_ssl.c:104:1: error: 'SSLv2_method' undeclared here (not in a function)
ossl_ssl.c:105:1: error: 'SSLv2_server_method' undeclared here (not in a function)
ossl_ssl.c:106:1: error: 'SSLv2_client_method' undeclared here (not in a function)
ossl_ssl.c:107:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:107:5: warning: (near initialization for 'ossl_ssl_method_tab[6].func') [enabled by default]
ossl_ssl.c:108:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:108:5: warning: (near initialization for 'ossl_ssl_method_tab[7].func') [enabled by default]
ossl_ssl.c:109:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:109:5: warning: (near initialization for 'ossl_ssl_method_tab[8].func') [enabled by default]
ossl_ssl.c:110:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:110:5: warning: (near initialization for 'ossl_ssl_method_tab[9].func') [enabled by default]
ossl_ssl.c:111:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:111:5: warning: (near initialization for 'ossl_ssl_method_tab[10].func') [enabled by default]
ossl_ssl.c:112:5: warning: initialization from incompatible pointer type [enabled by default]
ossl_ssl.c:112:5: warning: (near initialization for 'ossl_ssl_method_tab[11].func') [enabled by default]
ossl_ssl.c: In function 'ossl_ssl_get_cipher':
ossl_ssl.c:1224:12: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
make[1]: *** [ossl_ssl.o] Error 1
make[1]: Leaving directory `/tmp/ruby-build.20111026110110.14103/ruby-enterprise-1.8.7-2011.03/source/ext/openssl'
make: *** [all] Error 1

This by itself is a known issue, see http://bit.ly/sa4TAo

But there's no way to pass a patch to ruby-build to overcome this.

ruby build always downloads the tar file when attempting build

I am trying to integrate ruby-build into a puppet recipe and while testing I noticed that it downloads the tar file every time I call it. Apparently it doesn't keep the tar file around or it does not check before downloading again.

wget -nc works nicely in these situations.

Default install location

Would it be possible to configure a default install location, e.g.

$ cat ~/.ruby-build
location="~/local/ruby-"

So that:

$ ruby-build 1.9.2-p290 

Would be the same as:

$ ruby-build 1.9.2-p290 ~/local/ruby-1.9.2-p290

libncursesw5-dev for ruby 1.9+

Without this lib utf8 chars are broken in curses (commandline apps),
it would be great if it would somehow get installed before installing ruby.
Its no hard dependency, just a nice thing to have.

1.9.3-p0 build failed on OS X Lion 10.7.2

$ rbenv install 1.9.3-p0
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/cjbottaro/.rbenv/versions/1.9.3-p0
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz...
Installing ruby-1.9.3-p0...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/98/83mjk36d4ts49lpbjvbz48f80000gn/T/ruby-build.20111030161956.28281
Results logged to /var/folders/98/83mjk36d4ts49lpbjvbz48f80000gn/T/ruby-build.20111030161956.28281.log

Last 10 log lines:
ossl_x509store.c: In function ‘ossl_x509stctx_set_flags’:
ossl_x509store.c:520: warning: ‘X509_STORE_CTX_set_flags’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:464)
ossl_x509store.c: In function ‘ossl_x509stctx_set_purpose’:
ossl_x509store.c:532: warning: ‘X509_STORE_CTX_set_purpose’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:460)
ossl_x509store.c: In function ‘ossl_x509stctx_set_trust’:
ossl_x509store.c:544: warning: ‘X509_STORE_CTX_set_trust’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:461)
ossl_x509store.c: In function ‘ossl_x509stctx_set_time’:
ossl_x509store.c:561: warning: ‘X509_STORE_CTX_set_time’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:466)
linking shared-object openssl.bundle
make: *** [build-ext] Error 2

I did a brew installation of both rbenv and ruby-build about 15 mins ago, so I should be all up to date.

Should support zero-documentation install

Ruby-Build should support installing ruby and rubygems with zero documentation files.

There are about 60MB of documentation files installed by default into /usr/local/share/ri/1.9.1/system/. Ruby-Build should support installing ruby/rubygems without these files.

A use case is installing Ruby automatically on many identically-configured servers. One needs a single copy of the documentation locally, but does not need dozens of copies of the documentation on remote servers. Rather, it would be useful to save on disk space (60MB here, 50MB there, eventually it adds up to a lot).

ree-1.8.7-2011.03 fails to install on OSX Lion (readline issues)

I came across this issue with ruby-build, OSX Lion and REE (ree-1.8.7-2011.03)
Basically I couldn't install it properly due to common Readline issues, mentioned here

readline.c: In function ‘username_completion_proc_call’:  
readline.c:734: error: ‘username_completion_function’ undeclared (first use in this function)  
readline.c:734: error: (Each undeclared identifier is reported only once  
readline.c:734: error: for each function it appears in.)  
make[1]: *** [readline.o] Error 1 

I have readline installed OK (via brew) to /usr/local/Cellar/readline/6.2.1and the solution is to supply the REE installer with the --with-readline-dir configure option. So naturally I tried;

CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)" rbenv install ree-1.8.7-2011.03

Unfortunately, looking in the code for ruby-build, it seems that CONFIGURE_OPTS is ignored for REE installs

The build_package_ree_installer method pays no attention to the CONFIGURE_OPTS environment variable.

To compound the problem on OSX Lion, we can't simply use CONFIGURE_OPTS as an argument to the REE ./installer command, since its prefixed with '--with-gcc' set in the use_gcc42_on_lion method.

My suggested fix below introduces a new env variable, REE_CONFIGURE_OPTS, used only in the build_package_ree_installer method. With this patch applied, I could now successfully install REE on OSX Lion with the following command to rbenv;

REE_CONFIGURE_OPTS="-c --enable-shared -c --with-readline-dir=$(brew --prefix readline)" rbenv install ree-1.8.7-2011.03

Any questions or comments, or if you've had the same problem please let me know.

Matt

Patch

- 138:  { ./installer --auto "$PREFIX_PATH" --dont-install-useful-gems $options
+ 138: { ./installer --auto "$PREFIX_PATH" --dont-install-useful-gems $options $REE_CONFIGURE_OPTS 

ruby-build: definition not found: 1.9.2-p290

Trying to install 1.9.2-p290 in what appears to be a Red Hat machine. uname -a gives:

Linux web202.webfaction.com 2.6.18-238.9.1.el5PAE #1 SMP Tue Apr 12 18:52:55 EDT 2011 i686 i686 i386 GNU/Linux

when I do 'ruby-build --definitions', I get:

I'm on ruby-build 20111030.

Is Ruby 1.9.3.rc1 production-ready?

Or, to put it another way, are you using 1.9.3 in production at 37signals?

I ask because I'm on 1.9.2-p290 and Rails 3.0.10, and while my app runs snappily its startup is glacial.

Thanks for this great software, and rbenv too!

use check-install?

Is there any chance you could change ruby-build to use check-install & dpkg on debian/ubuntu? Then I could use it with my teleport gem:

https://github.com/rglabs/teleport

I'd love to get rid of my ruby install code and I'm sure your version is much better. But I also want users to be able to UN-install.

Thanks - Adam

GCC error on Lion 10.7.2 and XCode 4.2 fresh install

Seems that latest XCode 4.2 don't install (non-llvm) gcc-4.2 anymore.

$ ls -l /usr/bin | grep gcc

lrwxr-xr-x    1 wsouto  wheel    12B 14 Out 17:55 cc -> llvm-gcc-4.2
lrwxr-xr-x    1 wsouto  wheel    12B 14 Out 17:55 gcc -> llvm-gcc-4.2
lrwxr-xr-x    1 wsouto  admin    52B 14 Out 17:55 i686-apple-darwin11-llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11llvm-g++-4.2
lrwxr-xr-x    1 wsouto  admin    52B 14 Out 17:55 i686-apple-darwin11-llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2
lrwxr-xr-x    1 wsouto  admin    32B 14 Out 17:55 llvm-cpp-4.2 -> ../llvm-gcc-4.2/bin/llvm-cpp-4.2
lrwxr-xr-x    1 wsouto  admin    32B 14 Out 17:55 llvm-g++ -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x    1 wsouto  admin    32B 14 Out 17:55 llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x    1 wsouto  admin    32B 14 Out 17:55 llvm-gcc -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
lrwxr-xr-x    1 wsouto  admin    32B 14 Out 17:55 llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2

Installing the osx-gcc-installer solves the problem for now.

This info might be useful for someone...

JRuby 1.7.0-dev snapshot url broken

Hi,

the download url of the 1.7.0-dev snapsho has changed:

$rbenv install jruby-1.7.0-dev
Downloading http://ci.jruby.org/snapshots/jruby-bin-1.7.0.dev.tar.gz...

BUILD FAILED

see my pull request.

JRuby recipes that upgrade rubygems breaks maven integration

JRuby ships with maven integration (allowing you to do gem mvn:rhino:js for example) in rubygems. Upgrading rubygems overwrites these custom rubygems libraries.

Is upgrading them explicitly (currently only done in 1.6.4 and 1.7.0-dev) required. This seems like something the user could do easily later if needed.

Support for additional ./configure flags

Hi there,

I like to use ruby/irb with readline support (vi key bindings). I had to modify the two "./configure" lines in your ruby-build script to get there.

Modified version: ./configure --with-readline-dir="/usr/local/Cellar/readline/6.2.1" ...

Did I miss an easy way to accomplish this or should this be supported by a flag?

Anyways, I like the rbenv/ruby-build combination.

rbenv-install belongs to rbenv

I would think that rbenv-install really belongs with rbenv not ruby-build. I think it would be better to move it to that project, or alternately make it a separate program on it's own.

I realize one can just ignore rbenv-install, but I think the separation is better. Also, per my next issue (#103), I think it makes even more sense.

ruby-build doesn't seem to find gcc even though it it installed

I'm using ruby-build 20111030 and Mac OS X (10.7.2)

$ ruby-build -v
ruby-build 20111030

When I try to build ruby 1.8.7-p249, ruby-build tells me it couldn't find a suitable gcc binary on my system

$ ruby-build 1.8.7-p249 ~/.rbenv/versions/1.8.7-p249

ERROR: This package must be compiled with GCC, and we
couldn't find a suitable `gcc' binary on your system.
Please install GCC and try again.

As of version 4.2, Xcode is LLVM-only and no longer
includes GCC. You can install GCC with these binary
packages on Mac OS X:

https://github.com/kennethreitz/osx-gcc-installer/downloads


BUILD FAILED

But it looks like gcc is correctly installed on my system :

$ which gcc
/usr/bin/gcc

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Any idea?

ruby-build should have a version number

I'm currently in the process of cleaning up my rbenv, ruby-build and ruby-gemset Debian packages in order to release them as a PPA.

It would be great if ruby-build had a version number that I could use for this purpose. (Even if it's just 0.1.0.pre1 or something similar.)

Patch 1.9.2-p290

Ruby 1.9.2-p290 (at least built with ruby-build, 1.9.2-p290 from RVM worked fine) seems to have strange issues with pry and yard. More about them pry/pry#215. lsegal suggested to apply this patch — ruby/ruby@be953b4
Maybe ruby-build should apply it by default?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.