Giter Site home page Giter Site logo

postmodern / ruby-install Goto Github PK

View Code? Open in Web Editor NEW
1.9K 54.0 250.0 1.17 MB

Installs Ruby, JRuby, Rubinius, TruffleRuby or MRuby

License: MIT License

Shell 91.84% Ruby 1.01% Makefile 1.75% Roff 5.40%
ruby installer jruby rubinius truffleruby mruby shell rubies

ruby-install's Introduction

ruby-install

Installs Ruby, JRuby, TruffleRuby (native / GraalVM), or mruby.

Features

  • Supports installing arbitrary versions.
  • Supports downloading the latest versions and checksums from ruby-versions.
  • Supports installing into /opt/rubies/ for root and ~/.rubies/ for users by default.
  • Supports installing into arbitrary directories.
  • Supports downloading from arbitrary URLs.
  • Supports downloading from mirrors.
  • Supports downloading/applying patches.
  • Supports specifying arbitrary ./configure options.
  • Supports downloading archives using wget or curl.
  • Supports verifying downloaded archives via MD5, SHA1, SHA256 or SHA512 checksums.
  • Supports installing build dependencies via the package manager:
  • Has tests.

Anti-Features

  • Does not require updating every time a new Ruby version comes out.
  • Does not require recipes for each individual Ruby version or configuration.
  • Does not support installing trunk/HEAD or nightly rolling releases.
  • Does not support installing unsupported/unmaintained versions of Ruby.

Requirements

  • bash >= 3.x
  • grep
  • wget > 1.12 or curl
  • md5sum or md5
  • sha1sum or sha1
  • sha256sum or sha256
  • sha512sum or sha512
  • tar
  • bzip2
  • xz
  • patch (if --patch is specified)
  • gcc >= 4.2 or clang

Synopsis

List supported Rubies and their current stable versions:

$ ruby-install

Updates then list the supported Rubies and their current stable versions:

$ ruby-install --update

Install the current stable version of Ruby:

$ ruby-install ruby

Install the latest version of Ruby:

$ ruby-install --update ruby

Install a stable version of Ruby:

$ ruby-install ruby 3.1

Install a specific version of Ruby:

$ ruby-install ruby 3.1.2

Install a Ruby into a specific directory:

$ ruby-install --install-dir /path/to/dir ruby

Install a Ruby into a specific rubies directory:

$ ruby-install --rubies-dir /path/to/rubies/ ruby

Install a Ruby into /usr/local:

$ ruby-install --system ruby 3.1.2

Install a Ruby from an official site with directly download:

$ ruby-install -M https://ftp.ruby-lang.org/pub/ruby ruby 3.1.2

Install a Ruby from a mirror:

$ ruby-install -M http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby ruby 3.1.2

Install a Ruby with a specific patch:

$ ruby-install -p https://raw.github.com/gist/4136373/falcon-gc.diff ruby 1.9.3-p551

Install a Ruby with a specific C compiler:

$ ruby-install ruby 3.1.2 -- CC=clang

Install a Ruby with specific configuration:

$ ruby-install ruby 3.1.2 -- --enable-shared --enable-dtrace CFLAGS="-O3"

Install a Ruby without installing dependencies first:

$ ruby-install --no-install-deps ruby 3.1.2

Uninstall a Ruby version:

$ rm -rf ~/.rubies/ruby-3.1.2

Integration

Using ruby-install with RVM:

$ ruby-install --rubies-dir ~/.rvm/rubies ruby-3.2.0-preview3

Using ruby-install with rbenv:

$ ruby-install --install-dir ~/.rbenv/versions/3.2.0-preview3 ruby-3.2.0-preview3

ruby-install can even be used with Chef.

Install

wget https://github.com/postmodern/ruby-install/releases/download/v0.9.3/ruby-install-0.9.3.tar.gz
tar -xzvf ruby-install-0.9.3.tar.gz
cd ruby-install-0.9.3/
sudo make install

PGP

All releases are PGP signed for security. Instructions on how to import my PGP key can be found on my blog. To verify that a release was not tampered with:

wget https://github.com/postmodern/ruby-install/releases/download/v0.9.3/ruby-install-0.9.3.tar.gz.asc
gpg --verify ruby-install-0.9.3.tar.gz.asc ruby-install-0.9.3.tar.gz

Homebrew

ruby-install can also be installed with homebrew:

brew install ruby-install

Or the absolute latest ruby-install can be installed from source:

brew install ruby-install --HEAD

Arch Linux

ruby-install is already included in the AUR:

yaourt -S ruby-install

Fedora Linux

ruby-install is available on Fedora Copr.

FreeBSD

ruby-install is included in the official FreeBSD ports collection:

cd /usr/ports/devel/ruby-install/ && make install clean

Known Issues

Please see the wiki.

Alternatives

Endorsements

I like the approach you're taking. Curious to see how it plays out.

-- Sam Stephenson of rbenv

ruby-install's People

Contributors

agis avatar emptyflask avatar eregon avatar fesplugas avatar freedomben avatar gevans avatar havenwood avatar hone avatar hsbt avatar jacknagel avatar jmettraux avatar juanitofatas avatar justincampbell avatar k0kubun avatar michaelrkn avatar missingcharacter avatar msnexploder avatar nicklamuro avatar nirvdrum avatar parndt avatar paul avatar pbrisbin avatar postmodern avatar rwstauner avatar samrees avatar spastorino avatar stefanozanella avatar trek avatar voxxit avatar yous 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

ruby-install's Issues

Do not hard code the path to brew

Homebrew can be installed anywhere. Personally, I have it installed in ~/.homebrew; consequently, ruby-install fails since it's looking for brew in /usr/local/bin/brew.

rubinius fails to compile

I am unable to compile rubinius through ruby-install. Works fine outside of it.

Compiling rubinius 2.0.0-rc1 ...
GEN vm/gen/config_variables.h
/Users/bgoff/.rvm/rubies/rbx-head/bin/rbx vm/codegen/config_vars.rb vm/gen/config_variables.h
An exception occurred running vm/codegen/config_vars.rb
undefined method `map' on nil:NilClass. (NoMethodError)

Not sure if this is because of the build that is being downloaded or what

Rubygems (gem) not installed for ruby 1.8.7

After installing 1.8.7 on my OSX (10.8.4) machine it appears that rubygems is not installed.

It then uses the system gem command:

gem env returns the following:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
  - INSTALLATION DIRECTORY: /Users/jeroen/.gem/ruby/1.8.7
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/jeroen/.gem/ruby/1.8.7/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-12
  - GEM PATHS:
     - /Users/jeroen/.gem/ruby/1.8.7
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["https://rubygems.org", "http://private.gems.openminds.be"]
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org
     - http://private.gems.openminds.be

I guess you don't need it, but I'm using chruby to manage my ruby versions.

Warn users that ruby 1.8.x is EOLed?

As suggested by @mpapis, should we print a warning message to users that ruby 1.8.x is no longer maintained? Since the default version for Ruby is 2.0.0, a user would have to explicitly specify they want 1.8.

Problem with applying patches to a ruby

Hi,

I worked up what I thought would be a cool labor saving tip to applying a bunch of patches to a ruby for this repo's wiki..

https://github.com/postmodern/ruby-install/wiki/Tip:-Apply-many-patches-to-MRI-source-one-liner

Only problem is, after applying a particular group of patches, configure blows up when creating the Makefile:

https://gist.github.com/zhando/5941699

This ruby, 1.9.3-p385 builds fine for vanilla ruby-install (no patches).. It works fine for my ruby-build "recipe" which includes all of those very same patches.

Something glitches however when you use bash parameter substitution to specify a group of patches to ruby-install - for this particular ruby anyway.. The patches all seem to apply cleanly..

Try it.. I'm curious to know what you all think.

Handle Mountain Lion/Ruby 2.0/OpenSSL debacle

Great work on ruby-install!

I used it to install Ruby 2.0, but lost some time dealing with Ruby 2.0's handling of OpenSSL. Ruby 2.0 refuses to use Mountain Lion's crippled version, and Homebrew does not symlink the updated version. Users installing Ruby 2.0 on OS X need to do the following:

$ brew install openssl
$ ruby-install ruby 2.0 -- --with-openssl-dir=`brew --prefix openssl`

What makes this confusing is that configure incorrectly reports that the option is unknown, but then goes ahead and uses it. I think ruby-install should help out here. Rubies without OpenSSL support will have a hard time pulling gems down, so they're pretty much DOA for most users.

One suggestion: ruby-install could look for probe for an updated OpenSSL:

$ brew --prefix openssl

And pass that to configure for MRI 2.x on OS X.

Add files to build mruby

Add functions.sh, dependencies.txt and md5.txt for mruby. This may require us to change ruby-install to accommodate pulling down a git repo instead of downloading an archive.

Add getopt option parsing

Need to parse the following options:

  • --src-dir DIR
  • --install-dir DIR
  • --patch FILE
  • --skip-sync
  • --skip-dependencies (implies --skip-sync)
  • --skip-verify

Any additional options (after the -- separator) will be treated as ./configure options.

pacman -Sy is a Bad Idea

https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby-install.sh#L97

It's well known[1] in the Arch world that pacman -Sy foo can break your system. Users are advised never to update the index without also updating the system.

pacman -Sy; pacman -S foo is just a variation on that. I suggest you leave the index un-updated and just install the dep by name at whatever version the current index specifies.

1: https://bbs.archlinux.org/viewtopic.php?id=89328

This is just one example thread I could find. There's some back and forth, but Allan spells out the issue clearly in a few replies, and he's a core pacman dev / Arch maintainer.

Add md5 or sha1 checksums

Add support for checksuming the downloaded Ruby archives. Checksums should be stored in an checksums.txt file. If there is no checksum for the archive, print a warning and continue. If the checksum does not match the archive, print and error and return.

Space in directory being read as argument.

I'm trying to install ruby in a specific directory and the directory name has a space in it. So when I run the command.....

$ ruby-install -i /this directory/here ruby 1.9.3

OR

$ ruby-install -i /this\ directory/here ruby 1.9.3

I get this

ruby-install: too many arguments: directory/here ruby 1.9.3

It looks like after the space, the rest of the directory is being read as an argument.

Support Rubinius >= 2.0.0

Only support rubinius >= 2.0.0, dropping support for 2.0.0-rc1 and 1.2.4.

  • Download from http://releases.rubini.us/rubinius-X.Y.Z.tar.bz2
  • Install LLVM 3.1, 3.2 or 3.3
    • Rubinius'es configure defaults to 3.2, but will 3.1 work for older distros (ex: Ubuntu 12.04LTS)?
  • Install Ruby >= 1.9.
    • Ready, Set, ... recommends Ruby 2.0, but can we get away with Ruby 1.9? Most distros now provide ruby 1.9 packages. Fedora, Arch, Gentoo and Mavarick offer ruby 2.0.
  • Install Bundler
    • Do we install via the package manager or via rubygems?
  • Run bundle install --gemfile="$SRC_DIR/$RUBY_SRC_DIR/Gemfile" in install_optional_deps or configure_ruby.

/cc @brixen

permission denied from brew

$ ruby-install ruby
>>> Installing ruby 2.0.0-p247 into /Users/jrochkind/.rubies/ruby-2.0.0-p247 ...
>>> Installing dependencies for ruby 2.0.0-p247 ...
Error: Permission denied - /Library/Caches/Homebrew/Formula/openssl.brewing
!!! Installing dependencies failed!

But per #54, trying to run sudo probably isn't the answer either. What's going on?

Installing jruby stable fails on OS X 10.8.3 using ruby-install 0.1.2

Installing jruby stable fails on OS X 10.8.3 using ruby-install 0.1.2:

c07604 at MAC-C07604 in ~ 
$ ruby-install jruby stable
>>> Installing jruby 1.7.4 into /Users/c07604/.rubies/jruby-1.7.4 ...
>>> Updating Package Manager
>>> Downloading http://jruby.org.s3.amazonaws.com/downloads/1.7.4/jruby-bin-1.7.4.tar.gz into /Users/c07604/src ...
--2013-05-30 13:50:59--  http://jruby.org.s3.amazonaws.com/downloads/1.7.4/jruby-bin-1.7.4.tar.gz
Resolving jruby.org.s3.amazonaws.com (jruby.org.s3.amazonaws.com)... 205.251.242.165
Connecting to jruby.org.s3.amazonaws.com (jruby.org.s3.amazonaws.com)|205.251.242.165|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20187733 (19M) [application/x-gzip]
Saving to: ‘/Users/c07604/src/jruby-bin-1.7.4.tar.gz’

100%[======================================================>] 20,187,733  2.50MB/s   in 8.5s   

2013-05-30 13:51:08 (2.26 MB/s) - ‘/Users/c07604/src/jruby-bin-1.7.4.tar.gz’ saved [20187733/20187733]

>>> Verifying jruby-bin-1.7.4.tar.gz ...
>>> Verified /Users/c07604/src/jruby-bin-1.7.4.tar.gz
/usr/local/bin/ruby-install: line 24: cd: /Users/c07604/src/jruby-1.7.4: No such file or directory

Oh, yeah, it would be nice if the src directory was under the .rubies directory.

Rubinius tarball fails to download if already cached from previous install attempts

I have tried to install Rubinius which failed due to some weird segfault (possibly my old hardware). When I tried another install I got the following error:

$ sudo ruby-install rubinius
>>> Installing rubinius 2.0.0-rc1 into /opt/rubies/rubinius-2.0.0-rc1 ...
>>> Installing dependencies for rubinius 2.0.0-rc1 ...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
automake is already the newest version.
bison is already the newest version.
flex is already the newest version.
g++ is already the newest version.
gcc is already the newest version.
libgdbm-dev is already the newest version.
libncurses5-dev is already the newest version.
libreadline-dev is already the newest version.
libyaml-dev is already the newest version.
rake is already the newest version.
ruby-dev is already the newest version.
zlib1g-dev is already the newest version.
libssl-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
llvm-3.0-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
>>> Downloading https://github.com/rubinius/rubinius/archive/release-2.0.0-rc1.tar.gz into /usr/local/src ...
--2013-07-15 13:56:02--  https://github.com/rubinius/rubinius/archive/release-2.0.0-rc1.tar.gz
Resolving github.com (github.com)... 204.232.175.90
Connecting to github.com (github.com)|204.232.175.90|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/rubinius/rubinius/tar.gz/release-2.0.0-rc1 [following]
--2013-07-15 13:56:03--  https://codeload.github.com/rubinius/rubinius/tar.gz/release-2.0.0-rc1
Resolving codeload.github.com (codeload.github.com)... 192.30.252.147
Connecting to codeload.github.com (codeload.github.com)|192.30.252.147|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘/usr/local/src/rubinius-2.0.0-rc1.tar.gz’

    [ <=>                                   ] 0           --.-K/s   in 0.4s    


Cannot write to ‘/usr/local/src/rubinius-2.0.0-rc1.tar.gz’ (Success).
!!! Download of https://github.com/rubinius/rubinius/archive/release-2.0.0-rc1.tar.gz failed!

In order to fix this I have to manually remove the Rubinius files from /usr/local/src and then start sudo ruby-install rubinius again.

Add --rubies-dir option

Add a --rubies-dir option, which controls the prefix of the install directory (ex: --rubies-dir /opt/rubies/ or --rubies-dir ~/.rubies/).

parallel make of ruby

It would be nice if ruby-install could do a parallel make of Ruby, according to the cpu core count. I haven't found an "official" statement as to whether Ruby's makefile really supports parallel make, though.

ruby-install symlink in ~/bin

Currently this doesn't work because it looks for ~/share (which I don't want to put there).

Solvable by replacing $0 with $(readlink -f $0) in line 5 of ruby-install.

Can't see how it would break any (sane) existing use cases.

`yum updateinfo` is not available in CentOS vanilla installations

On a fresh CentOS 6.4 installation, the updateinfo subcommand ran in the pre install stage is not available, but requires the installation of the yum-security (aka yum-plugin-security) package.
I don't know if this holds even in Fedora.

An option I see here is to allow for installation of the missing package before running it.
Another option is to document this thing and let the user satisfy the prerequisites.

If you want, I can take care of making a PR for solving it.

`ruby-install rubinius 2.0.0-rc1` doesn't work with Ruby 2.0.0

If you attempt to install rubinius 2.0.0-rc1 with Ruby 2.0.0 as active Ruby, you'll get a weird error:

undefined method `name' for -2.0000000000407714:Float

Even though this is Rubinius-bug, it would be nice if ruby-install would warn that you need Ruby 1.9.3.

Ruby 2.0 compile fails with "ld: can't open output file for writing"

Running ruby-install aaed1a4 on OS X 10.8.5 with Xcode 5.

>>> Compiling ruby 2.0.0-p247 ...
    CC = clang
    LD = ld
    LDSHARED = clang -dynamic -bundle
    CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration   -pipe
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
    CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/usr/local/Cellar/libyaml/0.1.4/include -I/usr/local/opt/gdbm/include -I/usr/local/opt/libffi/include   -I. -I.ext/include/x86_64-darwin12.5.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/usr/local/Cellar/libyaml/0.1.4/lib -L/usr/local/opt/gdbm/lib -L/usr/local/opt/libffi/lib  -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie
    SOLIBS =
linking miniruby
rbconfig.rb unchanged
generating enc.mk
generating prelude.c
compiling prelude.c
linking static-library libruby-static.a
verifying static-library libruby-static.a
generating encdb.h
encdb.h unchanged
making enc
make[1]: Nothing to be done for `enc'.
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
transdb.h unchanged
making trans
make[1]: Nothing to be done for `./enc/trans'.
making encs
generating makefile exts.mk
Failed to configure -test-/win32/dln. It will not be installed.
Failed to configure -test-/win32/fd_setsize. It will not be installed.
Failed to configure dl/win32. It will not be installed.
Failed to configure fiddle/win32. It will not be installed.
Failed to configure tk. It will not be installed.
Failed to configure tk/tkutil. It will not be installed.
Failed to configure win32ole. It will not be installed.
linking shared-object -test-/array/resize.bundle
ld: can't open output file for writing: ../../../../.ext/x86_64-darwin12.5.0/-test-/array/resize.bundle, errno=2 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../../../.ext/x86_64-darwin12.5.0/-test-/array/resize.bundle] Error 1
make[1]: *** [ext/-test-/array/resize/all] Error 2
make: *** [build-ext] Error 2
!!! Compiling ruby 2.0.0-p247 failed!
$ clang --version
Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

curl: (3) <url> malformed

When I attempt to install (any) Ruby, this happens:

c07604 at MAC-C07604 in ~ 
$ ruby-install ruby
>>> Installing ruby 1.9.3-p429 into /Users/c07604/.rubies/ruby-1.9.3-p429 ...
>>> Updating Package Manager
Already up-to-date.
>>> Installing dependencies for ruby 1.9.3-p429 ...
Warning: openssl-1.0.1e already installed
Warning: readline-6.2.4 already installed
Warning: libyaml-0.1.4 already installed
Warning: gdbm-1.10 already installed
Warning: libffi-3.0.13 already installed
>>> Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.bz2 into /Users/c07604/src ...
curl: (3) <url> malformed
BZh91AY&SY??!????????????????????????????????|cl???=(S6H???l"?????W??X?bf??????=??>?l>?????Ǧ???)?h?>???{?:_O??pw??f??n?+7??
                             ??_Z՟m?j??????F?$Q???=R??}?B?]??|>????/?o?????}}??G????ozC̀P????7Y?j???k??n??^�??|??}?=?z???|?z?c??????????j>^{3????sd?$wo??;??????ܟ`??qGA????h??[?*B6]??6?Iu????>M????N??y??6???{????מ?a???x???:???Gm???ޢ=?UWt????vu???G?H???Wu?J?jP??IBk/Y???t?"???HҾs{}x??K??%1b8?{?Ұ_g ??k?|޹?,:?neUTvԒ????$?,??Һ7?l]??݁?W?Ƽ/cC?o?E?j?????[????[???a??p??W
                                                                          ??E?z{??v?[E5?w7???gݐt
                                                                                               ??Z?7?:.?
??t
 ?
i???

install of 1.9.4-p448 failing in weird ways

According to the docs, I can get the latest 1.9 mri with ruby-install ruby 1.9

But that results in this:

$ ruby-install ruby 1.9
grep: brackets ([ ]) not balanced
>>> Installing ruby 1.9:    1.9.3-p448 into /Users/jrochkind/.rubies/ruby-1.9:    1.9.3-p448 ...
>>> Installing dependencies for ruby 1.9:    1.9.3-p448 ...
Error: No available formula for brew:
!!! Installing dependencies failed!

Huh?

Ruby installs directly into $INSTALL_DIR

Setting a custom install dir with the -i flag installs the ruby files directly into that directory. eg.

ruby-install -i /usr/local/opt/rubies ruby 2.0.0-p0
ls /usr/local/opt/rubies
# bin include lib share

The expected result, based on the README, is:

ruby-install -i /usr/local/opt/rubies ruby 2.0.0-p0
ls /usr/local/opt/rubies
# ruby-2.0.0-p0

I think the fix is something to do with this, and that $RUBY-$RUBY_VERSION should be specified outside of the ${...} thing? I'm not entirely sure. 😕

# share/ruby-install/functions.sh
if [[ $UID -eq 0 ]]; then
    SRC_DIR="${SRC_DIR:-/usr/local/src}"
    INSTALL_DIR="${INSTALL_DIR:-/opt/rubies/$RUBY-$RUBY_VERSION}"
else
    SRC_DIR="${SRC_DIR:-$HOME/src}"
    INSTALL_DIR="${INSTALL_DIR:-$HOME/.rubies/$RUBY-$RUBY_VERSION}"
fi

installing jruby-1.7.4 fails

Environment:

  • Ubuntu 13.10 Saucy Salamander x86_64
  • rbenv 0.4.0-65-gff23666 (latest)
  • ruby-install 463e15b (latest)

I installed ruby 2.1.0-preview1 without problems. Instead, attempting to install jruby-1.7.4 installation fails with the following error:

BUILD FAILED

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

Last 10 log lines:
jruby-1.7.4/samples/xslt.rb
jruby-1.7.4/tool/nailgun/src/
jruby-1.7.4/tool/nailgun/src/c/
jruby-1.7.4/tool/nailgun/Makefile.in
jruby-1.7.4/tool/nailgun/README.txt
jruby-1.7.4/tool/nailgun/ng.exe
jruby-1.7.4/tool/nailgun/src/c/ng.c
jruby-1.7.4/tool/nailgun/configure
/tmp/ruby-build.20131005024253.16683/jruby-1.7.4 /tmp/ruby-build.20131005024253.16683 ~
No such pass: java.lang.ClassNotFoundException: org/jruby/ir/passes/null

BSD `stat` and GNU `stat` take different options

When installing any ruby, I get:

» ruby-install ruby 2.0
>>> Installing ruby 2.0.0-p247 into /Users/rando/.rubies/ruby-2.0.0-p247 ...
>>> Installing dependencies for ruby 2.0.0-p247 ...
stat: cannot read file system information for ‘%Su’: No such file or directory
sudo: unknown user:   File: "/usr/local/bin/brew"
    ID: 100000400000011 Namelen: *       Type: hfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 60987521   Free: 18827172   Available: 18763172
Inodes: Total: 60987519   Free: 18763172
!!! Installing dependencies failed!

This is because BSD stat (default on Darwin) takes a -f "%Su" option, while GNU coreutils stat uses -c "%u"

~  » stat --version
stat (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Michael Meskes.
~  » stat -f "%Su" /usr/local/bin/brew
stat: cannot read file system information for ‘%Su’: No such file or directory
  File: "/usr/local/bin/brew"
    ID: 100000400000011 Namelen: *       Type: hfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 60987521   Free: 18823880   Available: 18759880
Inodes: Total: 60987519   Free: 18759880
~  » stat -c "%U" /usr/local/bin/brew
rando

Before I start, is there any interest in a PR to fix this? Here's a fix to the same issue in another project: rtomayko/shocco#17

associative arrays are not supported by bash 3.2

Associative arrays (declare -A) were added in version 4.0 of bash and are used in ruby-install.

Better to make bash 4.0+ a requirement of ruby-install or backbend around not having associative arrays in order to support bash 3.2?

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.