Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

install binary rubies by default, close #1112

  • Loading branch information...
commit 56222bc92c5876c2a223c23bf600d84c9dbb262b 1 parent b8344e5
Michal Papis mpapis authored
17 help/install
View
@@ -1,6 +1,6 @@
## Usage
- rvm install {ruby-string} [--movable] [--verify-download {0,1,2}]
+ rvm install {ruby-string} [--verify-download {0,1,2}] [--binary|--disable-binary|--movable]
For a partial list of valid ruby strings please run
@@ -24,7 +24,20 @@ To do clean installation use:
rvm reinstall 1.9.2
-## Movable rubies
+## Binary rubies
+
+By default RVM will try to download binary ruby package instead of compiling.
+If such package is not available normal compilation will be performed.
+Using binary builds can significantly increase ruby installation time.

Don't you mean decrease installation time?

Michal Papis Collaborator
mpapis added a note

yes, thank you for pointing that out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+There are two options controlling binary rubies installation:
+
+- `--binary` - force binary installation, do not try to compile ruby.
+- `--disable-binary` - do not try binary ruby, always compile.
+
+More details about managing binary rubies can be found in `rvm help mount`.
+
+### Movable rubies
It is possible to build a ruby that can be moved to other locations, renamed
or even moved to other machine - as long as the system matches.
4 help/upgrade-notes.txt
View
@@ -60,3 +60,7 @@
* For first installed ruby RVM will: display rvm requirements, set it as default and use it.
To avoid this behavior either use full path to rvm binary or prefix it with `command `.
+
+ * Binary rubies are installed by default if available, you can read about it in help:
+ rvm help install
+ rvm help mount
29 scripts/cli
View
@@ -411,21 +411,24 @@ __rvm_parse_args()
rvm_ruby_name="$next_token"
next_token="${1:-}"
(( $# == 0 )) || shift
+ #TODO: ??? rvm_disable_binary_flag=1
;;
--branch)
rvm_ruby_repo_branch="$next_token"
next_token="${1:-}"
(( $# == 0 )) || shift
+ rvm_disable_binary_flag=1
;;
--repository|--repo|--url)
rvm_ruby_repo_url="$next_token"
next_token="${1:-}"
(( $# == 0 )) || shift
+ rvm_disable_binary_flag=1
;;
- -r|--remote)
+ -r|--remote|--binary)
rvm_remote_flag=1
while
[[ -n "${next_token:-}" ]] &&
@@ -459,6 +462,7 @@ __rvm_parse_args()
next_token="${1:-}"
(( $# == 0 )) || shift
rvm_patch_original_pwd="$PWD"
+ rvm_disable_binary_flag=1
;;
--arch|--archflags)
@@ -466,26 +470,31 @@ __rvm_parse_args()
rvm_architectures="${rvm_architectures##,}" ;
next_token="${1:-}"
(( $# == 0 )) || shift
+ rvm_disable_binary_flag=1
;;
--with-arch=*)
rvm_architectures="${rvm_architectures:-},${rvm_token#--with-arch=}" ;
rvm_architectures="${rvm_architectures##,}" ;
+ rvm_disable_binary_flag=1
;;
--32)
rvm_architectures="${rvm_architectures:-},i386" ;
rvm_architectures="${rvm_architectures##,}" ;
+ rvm_disable_binary_flag=1
;;
--64)
rvm_architectures="${rvm_architectures:-},x86_64" ;
rvm_architectures="${rvm_architectures##,}" ;
+ rvm_disable_binary_flag=1
;;
--universal)
rvm_architectures="${rvm_architectures:-},i386,x86_64" ;
rvm_architectures="${rvm_architectures##,}" ;
+ rvm_disable_binary_flag=1
;;
--bin)
@@ -542,6 +551,7 @@ __rvm_parse_args()
rvm_token=${rvm_token//-/_}
export "rvm_ruby_${rvm_token}"="$next_token"
next_token="${1:-}"
+ rvm_disable_binary_flag=1
(( $# == 0 )) || shift
;;
@@ -573,10 +583,11 @@ __rvm_parse_args()
rvm_pretty_print_flag=auto
;;
- --1.8|--1.9)
+ --1.8|--1.9|--18|--19)
rvm_token=${rvm_token#--}
rvm_token=${rvm_token//\./}
export "rvm_${rvm_token}_flag"=1
+ rvm_disable_binary_flag=1
;;
--rvmrc|--versions-conf|--ruby-version)
@@ -585,7 +596,13 @@ __rvm_parse_args()
export rvm_rvmrc_flag="${rvm_token}"
;;
- --self|--gem|--rubygems|--reconfigure|--default|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--cron|--tail|--delete|--verbose|--import|--sticky|--create|--gems|--docs|--skip-autoreconf|--18|--19|--force-autoconf|--auto|--autoinstall-bundler|--ignore-gemsets|--skip-gemsets|--debug|--head|--static|--quiet|--silent)
+ --head|--static)
+ rvm_token=${rvm_token#--}
+ rvm_token=${rvm_token//-/_}
+ export "rvm_${rvm_token}_flag"=1
+ ;;
+
+ --self|--gem|--rubygems|--reconfigure|--default|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--cron|--tail|--delete|--verbose|--import|--sticky|--create|--gems|--docs|--skip-autoreconf|--force-autoconf|--auto|--autoinstall-bundler|--disable-binary|--ignore-gemsets|--skip-gemsets|--debug|--quiet|--silent)
rvm_token=${rvm_token#--}
rvm_token=${rvm_token//-/_}
export "rvm_${rvm_token}_flag"=1
@@ -601,6 +618,7 @@ __rvm_parse_args()
--clang)
rvm_configure_flags+=( --with-gcc=clang )
+ #TODO: ??? rvm_disable_binary_flag=1
;;
-M)
@@ -610,6 +628,7 @@ __rvm_parse_args()
__rvm_custom_separated_array rvm_make_flags , "${next_token}"
next_token="${1:-}"
(( $# == 0 )) || shift
+ rvm_disable_binary_flag=1
else
rvm_action="error"
rvm_error_message="--make *must* be followed by make flags."
@@ -642,6 +661,7 @@ __rvm_parse_args()
__rvm_custom_separated_array rvm_configure_flags , "${next_token}"
next_token="${1:-}"
(( $# == 0 )) || shift
+ rvm_disable_binary_flag=1
else
rvm_action="error"
rvm_error_message="--configure *must* be followed by configure flags."
@@ -650,10 +670,12 @@ __rvm_parse_args()
--movable)
rvm_configure_flags+=( --enable-shared --enable-load-relative --sysconfdir=/etc )
+ rvm_disable_binary_flag=1
;;
--with-*|--without-*|--enable-*|--disable-*)
rvm_configure_flags+=( "$rvm_token" )
+ rvm_disable_binary_flag=1
;;
--trace)
@@ -671,6 +693,7 @@ __rvm_parse_args()
then rvm_configure_flags+=( "$next_token" "$@" )
else rvm_ruby_args=( "$next_token" "$@" )
fi
+ rvm_disable_binary_flag=1
rvm_parse_break=1
;;
4 scripts/functions/environment
View
@@ -210,7 +210,7 @@ __rvm_run_with_env()
__rvm_setup()
{
# NOTE: the same set is located below - maker kjfdngkjd
- export rvm_head_flag rvm_ruby_selected_flag rvm_user_install_flag rvm_path_flag rvm_cron_flag rvm_static_flag rvm_default_flag rvm_loaded_flag rvm_llvm_flag rvm_skip_autoreconf_flag rvm_18_flag rvm_19_flag rvm_force_autoconf_flag rvm_dump_environment_flag rvm_verbose_flag rvm_debug_flag rvm_trace_flag rvm_pretty_print_flag rvm_create_flag rvm_remove_flag rvm_gemdir_flag rvm_reload_flag rvm_auto_reload_flag rvm_ignore_gemsets_flag rvm_skip_gemsets_flag rvm_install_on_use_flag rvm_remote_flag rvm_verify_downloads_flag
+ export rvm_head_flag rvm_ruby_selected_flag rvm_user_install_flag rvm_path_flag rvm_cron_flag rvm_static_flag rvm_default_flag rvm_loaded_flag rvm_llvm_flag rvm_skip_autoreconf_flag rvm_18_flag rvm_19_flag rvm_force_autoconf_flag rvm_dump_environment_flag rvm_verbose_flag rvm_debug_flag rvm_trace_flag rvm_pretty_print_flag rvm_create_flag rvm_remove_flag rvm_gemdir_flag rvm_reload_flag rvm_auto_reload_flag rvm_disable_binary_flag rvm_ignore_gemsets_flag rvm_skip_gemsets_flag rvm_install_on_use_flag rvm_remote_flag rvm_verify_downloads_flag
export rvm_gems_cache_path rvm_gems_path rvm_man_path rvm_ruby_gem_path rvm_ruby_log_path rvm_gems_cache_path rvm_archives_path rvm_docs_path rvm_environments_path rvm_examples_path rvm_gems_path rvm_gemsets_path rvm_help_path rvm_hooks_path rvm_lib_path rvm_log_path rvm_patches_path rvm_repos_path rvm_rubies_path rvm_scripts_path rvm_src_path rvm_tmp_path rvm_user_path rvm_usr_path rvm_wrappers_path rvm_externals_path
export rvm_ruby_strings rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_repo_branch rvm_ruby_revision rvm_ruby_tag rvm_ruby_sha rvm_ruby_version rvm_ruby_package_file rvm_ruby_name rvm_ruby_name rvm_ruby_args rvm_ruby_user_tag rvm_ruby_patch detected_rvm_ruby_name
export __rvm_env_loaded next_token rvm_error_message rvm_gemset_name rvm_parse_break rvm_token rvm_action rvm_export_args rvm_gemset_separator rvm_expanding_aliases rvm_architectures rvm_tar_command rvm_tar_options rvm_patch_original_pwd rvm_project_rvmrc rvm_archive_extension rvm_autoinstall_bundler_flag rvm_codesign_identity rvm_expected_gemset_name rvm_without_gems
@@ -292,7 +292,7 @@ __rvm_teardown()
# a corrupt PATH, breaking the RVM installation.
#
# NOTE: the same set is located above - maker kjfdngkjd
- unset rvm_head_flag rvm_ruby_selected_flag rvm_user_install_flag rvm_path_flag rvm_cron_flag rvm_static_flag rvm_default_flag rvm_loaded_flag rvm_llvm_flag rvm_skip_autoreconf_flag rvm_18_flag rvm_19_flag rvm_force_autoconf_flag rvm_dump_environment_flag rvm_verbose_flag rvm_debug_flag rvm_trace_flag rvm_pretty_print_flag rvm_create_flag rvm_remove_flag rvm_gemdir_flag rvm_reload_flag rvm_auto_reload_flag rvm_ignore_gemsets_flag rvm_skip_gemsets_flag rvm_install_on_use_flag rvm_remote_flag rvm_verify_downloads_flag
+ unset rvm_head_flag rvm_ruby_selected_flag rvm_user_install_flag rvm_path_flag rvm_cron_flag rvm_static_flag rvm_default_flag rvm_loaded_flag rvm_llvm_flag rvm_skip_autoreconf_flag rvm_18_flag rvm_19_flag rvm_force_autoconf_flag rvm_dump_environment_flag rvm_verbose_flag rvm_debug_flag rvm_trace_flag rvm_pretty_print_flag rvm_create_flag rvm_remove_flag rvm_gemdir_flag rvm_reload_flag rvm_auto_reload_flag rvm_disable_binary_flag rvm_ignore_gemsets_flag rvm_skip_gemsets_flag rvm_install_on_use_flag rvm_remote_flag rvm_verify_downloads_flag
unset rvm_gems_cache_path rvm_gems_path rvm_man_path rvm_ruby_gem_path rvm_ruby_log_path rvm_gems_cache_path rvm_archives_path rvm_docs_path rvm_environments_path rvm_examples_path rvm_gems_path rvm_gemsets_path rvm_help_path rvm_hooks_path rvm_lib_path rvm_log_path rvm_patches_path rvm_repos_path rvm_rubies_path rvm_scripts_path rvm_src_path rvm_tmp_path rvm_user_path rvm_usr_path rvm_wrappers_path rvm_externals_path
unset rvm_ruby_strings rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_repo_branch rvm_ruby_revision rvm_ruby_tag rvm_ruby_sha rvm_ruby_version rvm_ruby_package_file rvm_ruby_name rvm_ruby_name rvm_ruby_args rvm_ruby_user_tag rvm_ruby_patch detected_rvm_ruby_name
unset __rvm_env_loaded next_token rvm_error_message rvm_gemset_name rvm_parse_break rvm_token rvm_action rvm_export_args rvm_gemset_separator rvm_expanding_aliases rvm_architectures rvm_tar_command rvm_tar_options rvm_patch_original_pwd rvm_project_rvmrc rvm_archive_extension rvm_autoinstall_bundler_flag rvm_codesign_identity rvm_expected_gemset_name rvm_without_gems
52 scripts/functions/manage/base
View
@@ -236,6 +236,53 @@ __rvm_install_source()
rvm_log "Install of $rvm_ruby_string - #complete "
}
+__rvm_install_ruby_try_remote()
+{
+ : rvm_disable_binary_flag:${rvm_disable_binary_flag:=0}: rvm_remote_flag:${rvm_remote_flag:=0}:
+ (( rvm_disable_binary_flag )) ||
+ {
+ true "${rvm_remote_server:=$(__rvm_db "rvm_remote_server_url")}"
+ __rvm_detect_system
+ rubies=($(
+ rvm_ruby_url="${rvm_remote_server}/${_system_name}/${_system_version}/${_system_arch}/${rvm_ruby_string//\./\.}\.tar\..*"
+ awk -F/ '/'"${rvm_ruby_url//\//\/}"'/{print}' < $rvm_path/config/remote
+ ))
+ case ${#rubies[@]} in
+ (0)
+ if
+ (( rvm_remote_flag ))
+ then
+ rvm_error "Requested binary installation but no rubies are available to download, consider skipping --binary flag."
+ return 1
+ else
+ rvm_warn "No binary rubies available for: ${_system_name}/${_system_version}/${_system_arch}/${rvm_ruby_string}.
+Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies."
+ fi
+ ;;
+ (1)
+ if
+ rvm_remote_flag=1 "${rvm_scripts_path}/external" mount "$rvm_ruby_string"
+ then
+ return 0
+ else
+ rvm_warn "Mounting remote ruby failed, trying to compile."
+ fi
+ ;;
+ (*)
+ if
+ (( rvm_remote_flag ))
+ then
+ rvm_error "Requested binary installation but multiple rubies are available to download, this most likely is a bug, please report an issue!"
+ return 1
+ else
+ rvm_warn "More then one binary ruby found, this most likely is a bug, please report an issue!"
+ fi
+ ;;
+ esac
+ }
+ return 2 # continue with compilation
+}
+
__rvm_install_ruby()
{
true ${rvm_head_flag:=0} ${rvm_ruby_selected_flag:=0}
@@ -272,6 +319,11 @@ https://rvm.io/rubies/named/
unset RUBYOPT
fi
+ if __rvm_install_ruby_try_remote
+ then return 0
+ else (( $? == 2 )) || return 1 # 2 => continue with compilation
+ fi
+
if __rvm_check_for_compiler
then true # sok
else return $?
Joshua Flanagan

Don't you mean decrease installation time?

Michal Papis
Collaborator

yes, thank you for pointing that out!

Please sign in to comment.
Something went wrong with that request. Please try again.