Commit graph

652 commits

Author SHA1 Message Date
Mislav Marohnić
af454a32dc Silence errors when piping type | head -1 2019-10-23 12:12:38 +02:00
Hongli Lai
d38d18ec25
rbenv help: fix 'type: write error: Broken pipe'
Sometimes the command fails with a 'type: write error: Broken pipe'.
This is because 'head -1' only reads the first line, then exits.
If 'type' writes the second line after 'head -1' has already exited,
then the aforementioned error is triggered.

We fix this by buffering the entire output of 'type' before
invoking 'head -1'.
2019-10-23 08:29:03 +02:00
SHIBATA Hiroshi
577f04653d
Merge pull request #1191 from DestyNova/patch-1
Show how to update the list of available Ruby versions
2019-09-27 09:05:50 +09:00
Oisín
8ebf088360
Show how to update the list of available Ruby versions
It wasn't clear how to update the list of installable Ruby versions after installing rbenv from Git. This is a bit confusing for people who use rbenv to run third party Ruby apps rather than write their own and are less likely to know/care about the distinction between `rbenv` and `ruby-build`. I hadn't touched it for about 2 years and totally forgot that I'd need to manually update ruby-build.

Alternatively, it might be better to make ruby-build a git submodule.
2019-09-27 00:53:31 +01:00
Mislav Marohnić
4e923221ce
Merge pull request #1156 from rbenv/no-dir-traversal
Disallow path segments and directory traversal in `.ruby-version` files
2019-04-04 16:21:05 +02:00
Mislav Marohnić
370c26a6c9 Disallow path segments and directory traversal in .ruby-version files
A malicious `.ruby-version` file in the current directory could inject
`../../../` into the version string and trigger execution of binaries
outside of `RBENV_ROOT/versions/`.

Fixes #977 OVE-20170303-0004
2019-04-03 12:58:25 +02:00
Mislav Marohnić
a3fa9b73b8 rbenv 1.1.2 2019-03-25 15:00:39 +01:00
Mislav Marohnić
483e7f9bdf Clarify the description of rbenv versions
Fixes #1148
2019-02-18 21:38:08 +01:00
Mislav Marohnić
59785f6762
Merge pull request #1098 from blueyed/prefix-no-devnull
rbenv-prefix: do not silence rbenv-which for system version
2018-08-09 16:11:47 +02:00
Daniel Hahler
806f3f6ae2 rbenv-prefix: do not silence rbenv-which for system version
This suppressed any output when using RBENV_DEBUG=1 and does not really
hurt to have in the unlikely case that it should fail; you would get
two error messages now:

rbenv: ruby: command not found
rbenv: system version not found in PATH
2018-08-07 01:44:13 +02:00
Mislav Marohnić
1c772d5ff2
Merge pull request #1093 from blueyed/which
rbenv-which: change PATH only for the "command -v" lookup
2018-06-07 23:41:38 +02:00
Daniel Hahler
8103febc62 rbenv-which: change PATH only for the "command -v" lookup
This is not really necessary, because rbenv-which is used in a subshell
currently, but makes a difference if rbenv-which would be sourced.
2018-06-07 23:38:12 +02:00
jacob
8b18b962a3 make rbenv init more visible in the readme (#1092)
[ci skip]
2018-06-07 23:33:25 +02:00
Mislav Marohnić
199e598351 Remove ableist language 2018-06-05 16:49:13 +02:00
Mislav Marohnić
e55e3c05eb
Merge pull request #1083 from AlexWayfer/patch-1
Update instructions for $PATH change in README
2018-06-05 01:45:30 +02:00
Mislav Marohnić
bc1b66250f Link to rbenv-installer
Fixes #1001
2018-06-05 01:22:16 +02:00
Alexander Popov
dfba9f7608
Update instructions for $PATH change in README
Describe for Fish shell in details, prevent issues like #195 and #459.

Reference: https://fishshell.com/docs/2.7/tutorial.html#tut_path
2018-05-30 15:11:09 +03:00
Mislav Marohnić
c8ba27fd07
Merge pull request #1069 from viclim/fix-issue-1065
Ignore empty `.ruby-version` files
2018-02-26 10:53:46 +01:00
Victor Lim
9daf81f16e Fix https://github.com/rbenv/rbenv/issues/1065
Command `rbenv version-name > .ruby-version` will create an empty `.ruby-version` file
before running `rbenv-version-file`. This causes `rbenv-version-file` to return empty
string which in turn causes `rbenv-version-name` to return `system`.

Ensure size of `.ruby-version` is non-zero as a workaround.
2018-02-26 16:49:37 +08:00
Mislav Marohnić
b943955dbf
Merge pull request #981 from mhinz/shell-descriptive-error
Better error message for `rbenv shell`
2017-12-07 05:00:44 +01:00
Marco Hinz
643023d98f
Add tests for shell integration 2017-12-07 02:32:35 +01:00
Marco Hinz
af53c790cc
Better error message for rbenv shell
Shell integration is not enabled by default. This means that, from all the
commands from `rbenv commands`, only "shell" won't work right away.

Replace "no such command" with a more descriptive message that points to
`rbenv init` instead.
2017-12-07 02:32:34 +01:00
Mislav Marohnić
6aa70b6541
Merge pull request #1013 from blueyed/shellcheck
Fix some issues reported by shellcheck
2017-11-30 11:43:18 +01:00
Daniel Hahler
5f8a4c4d62 Fix some issues reported by shellcheck 2017-11-29 16:20:51 +01:00
Mislav Marohnić
eda952ab08 Merge branch 'cdpath-enable' 2017-11-29 15:53:41 +01:00
Mislav Marohnić
b80ea43e25 Quote directory name in variable assignment 2017-11-29 15:51:03 +01:00
Mislav Marohnić
c310bc5f83
Merge pull request #968 from maxnordlund/patch-1
Fix fish subcommand completion
2017-11-29 15:47:19 +01:00
Mislav Marohnić
eab68688dc
Merge pull request #959 from zenspider/fix-dash-u
Fixed `rbenv init -` output to work w/ no args and bash's `set -u`.
2017-11-29 15:40:23 +01:00
Mislav Marohnić
5183e32887
Merge pull request #982 from MartinNowak/issue759
partly resolve #759
2017-11-29 15:37:22 +01:00
Mislav Marohnić
e2f469a7cd
Merge pull request #1002 from blueyed/fix-which-tests-PATH
test/which.bats: do not export PATH
2017-11-29 15:25:03 +01:00
Mislav Marohnić
33a5c2495d
Merge pull request #1003 from blueyed/version-file-skip-dirs
rbenv-version-file: ensure that the version file is a file
2017-11-29 15:23:58 +01:00
Mislav Marohnić
66b9f6fb2b
Merge pull request #1024 from andyone/master
Fixed support for commas for all environment variables in configure script
2017-11-29 15:20:00 +01:00
Daniel Hahler
a9ca72ab8e test/which.bats: do not export PATH
Otherwise `sed` might not be found later in bats/libexec/bats-exec-test,
in case `/usr/bin` gets removed.
2017-11-20 04:22:05 +01:00
Ryan Davis
1a8b5e04a9 Fixed rbenv init - output to work w/ no args and bash's set -u. 2017-11-06 13:59:04 -08:00
Mislav Marohnić
2d7cefe782 Merge pull request #1034 from MinhThienDX/master
Fix URL fragment target
2017-09-04 18:57:27 +02:00
MinhThienDX
650c9d3452 Fix URL fragment target 2017-09-04 23:51:22 +07:00
Jeremy Daer
4ebd1bd12c Merge pull request #1009 from jeremy/homebrew-install-clarification
Clarify Homebrew/git install guidance
2017-08-23 14:47:56 -10:00
Anton Novojilov
dbaa8c83b6 Fixed support of build env vars for dynamic bash extension configure script 2017-08-07 13:12:37 +02:00
Mislav Marohnić
615f8443fe Merge pull request #1011 from kenaniah/patch-1
Properly escapes commas in c flags
2017-06-25 02:48:23 +02:00
Kenaniah Cerny
fc706daf60 properly escapes commas in cflags 2017-06-18 20:57:52 -07:00
Mislav Marohnić
6cd487db81 rbenv 1.1.1 2017-06-15 16:55:33 +02:00
Jeremy Daer
e3e99cc906
Clarify Homebrew/git install guidance
* Move Homebrew to the top, common case for new devs
* Note that `brew install rbenv` includes ruby-build by default
* Be clear that `rbenv init` instructions are needed for shell setup
* Be explicit about starting a new shell to pick up PATH/init changes
* Use rbenv-doctor to conclusively demonstrate correct setup
* Separate upgrade instructions for Homebrew vs Git installs

Related: https://github.com/rbenv/ruby-build/pull/1106
2017-06-14 09:02:50 -07:00
Daniel Hahler
95b1b05cbe rbenv-version-file: ensure that the version file is a file
Forwarded from https://github.com/pyenv/pyenv/pull/606.
2017-06-05 15:40:59 +02:00
Mislav Marohnić
755c820724 Merge pull request #986 from jeffkowalski/fix_init
Prefer 'set' over 'setenv' for fish shell
2017-05-17 00:34:20 +02:00
Mislav Marohnić
b4330a48b1 Merge pull request #999 from jacob-on-github/patch-1
Make homebrew installation instructions more clear
2017-05-17 00:12:52 +02:00
Jeff Kowalski
a81da8d864 Revert quoting change in previous commit; adjust test to match code
Revert back to original quoting style used before previous commit.
Adjust init.bats to reflect changes for successful tests.
2017-05-16 13:36:06 -07:00
jacob-on-github
4e27113494 Update README.md
I work on a team that has followed the Homebrew installations. More than once we've missed the `rbenv init` instruction and it has caused headaches down the road. This formatting makes it harder to miss.
2017-05-16 14:29:46 -05:00
Jeff Kowalski
be2e606fbd Prefer 'set' over 'setenv' for fish shell
The setenv function in fish shell has changed dramatically in
75600b6b53
It now conforms to the csh version, which takes at most two arguments.
In this init script, the form
    setenv PATH prepend_something $PATH
had been used, which had too many arguments.
Since setenv isn't a native command in fish, a suitable replacement is
to use the "set -gx" command, which can consume multiple arguments.
2017-04-06 23:55:48 -07:00
Tim Pope
9d93605e18 Don't unset CDPATH 2017-04-05 17:39:39 -04:00
Tim Pope
1f1e291385 Enforce absolute RBENV_DIR
This prevents CDPATH from becoming an issue.

Closes #866.
2017-04-05 16:54:03 -04:00