postmodern / ruby-install Goto Github PK
View Code? Open in Web Editor NEWInstalls Ruby, JRuby, TruffleRuby, or mruby
License: MIT License
Installs Ruby, JRuby, TruffleRuby, or mruby
License: MIT License
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.
We should also try to support install topaz 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.
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.
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???
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.
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
.
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.
Loaded plugins: fastestmirror
No such command: updateinfo. Please use /usr/bin/yum --help
!!!
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.
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.
Here's the output I'm getting:
https://gist.github.com/myronmarston/6699131
Any ideas how to fix this?
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?
Support an --md5
option, in case we don't have the md5 for a newer version.
$ 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?
Add an option to only extract/configure/build the Ruby, but not install it.
Allow downloading from an alternate URL.
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.
Should be able to skip downloading the archive, and use an existing one.
Now is a good time to fully support Rubinius.
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 an option to allow skipping syncing the package manager or installing packages from it.
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.
Environment:
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
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.
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.
Add a --rubies-dir
option, which controls the prefix of the install directory (ex: --rubies-dir /opt/rubies/
or --rubies-dir ~/.rubies/
).
Add an option to remove the 'ruby-' prefix from the Ruby name. For example, ruby-2.0.0-p195 would become 2.0.0-p195.
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
Rubinius is missing the Arch package names for pacman. https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/rubinius/dependencies.txt#L1
We should also try to support installing maglev.
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?
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.
That would be a killer feature.
Only support rubinius >= 2.0.0, dropping support for 2.0.0-rc1 and 1.2.4.
http://releases.rubini.us/rubinius-X.Y.Z.tar.bz2
configure
defaults to 3.2, but will 3.1 work for older distros (ex: Ubuntu 12.04LTS)?bundle install --gemfile="$SRC_DIR/$RUBY_SRC_DIR/Gemfile"
in install_optional_deps
or configure_ruby
./cc @brixen
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.
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
I cannot install it with ruby-install.. it points to the RC1 :(
But http://rubini.us/2013/10/04/rubinius-2-0-released/?utm_source=rubyweekly&utm_medium=email
Allow installing binary Rubies. JRuby and Rubinius both have binary packages. RVM provides precompiled versions of MRI. http://rvm.io/binaries/
Currently the fetch function can only strip
whitespace. It needs to also strip\t
characters.
How long should we continue supporting building Ruby 1.8?
ruby >= 2.0 supports dynamic probes using systemtap on Linux. The systemtap headers should be added to the dependencies.
When installing if the source files are already there ruby-install quits with:
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
!!! Download of https://github.com/rubinius/rubinius/archive/release-2.0.0-rc1.tar.gz failed!
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
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.
Support downloading archives using curl
, if wget
isn't available.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.