Comments (10)
Coworker of @dirschn here, with a small gotcha. I'm observing with rbenv 1.2.0-80-gd6bb1c6
that while gem install
appears to trigger automatic rehashing, bundle
does not.
We include the following in our setup script, haven't added cli tools in a while, and strongly encourage binstub/bundle exec
usage, hence @dirschn's confusion
system('bundle check') || system!('bundle install')
system('if command -v rbenv &> /dev/null; then rbenv rehash; fi')
Since the majority of rails devs will be installing tools via bundle
, that might warrant leaving this section in for now at least (perhaps open an issue with the rbenv team to expand functionality to bundle
? and then this could be removed).
from content.
Huh, that's interesting behavior. So to get my mental notes on this straight:
The following triggers a rehash:
gem install foo-bar-with-executable
While the following command in a project with a Gemfile containing entry for gem
foo-bar-with-executable
:bundle install
will not then execute rehash and therefore
foo-bar-with-executable
will not be available correctly?
Yes that's correct.
I am a little bit confused as I have not yet had the need for bundler + rbenv combo, is it regularly expected that bundle install would make
foo-bar-with-executable
available on regular path with rbenv after a rehash?A rewording or similar might be warranted though if it works for all but bundler environments.
So after some more investigation, I've figured out that this is in fact a bug with rbenv
- rbenv/rbenv#1540 (i.e. there is code for automatic rehashing specifically for bundle install
, but it doesn't work).
from content.
Thanks! I think it should now be adjusted to say to either update rbenv (with reference to either this discussion or rather the upstream PR) if pulled via git by user or state that in the other case the rehash is needed for bundler install
:)
Either way, we have an answer for whether it's needed, if any of you would manage to write something up, I'd immensely appreciate it.
from content.
I have created #498, I also fixed up the styling and whatnot on the page. If you want to, you can check the section regarding rbenv on the PR and review it.
from content.
That's my bad, it was a busy week and this slipped my mind. I'll take a look when I get home from work.
from content.
Thanks for taking time sharing this!
Yeah we were discussing this recently on some rbenv related pull request whether that's needed, we left it there due to not being sure. Thanks for finding the reference that it isn't needed, We can fix that with confidence now.
Alternatively, you can edit the page yourself here: https://github.com/developer-portal/content/blob/master/start/sw/web-app/rails.md , we have some related info for contributing here: https://developer-portal.github.io/contributing/
from content.
I can make the edit either later today or sometime tomorrow, if you like! I've been wanting to get into open source contributions so why not start here!
from content.
Huh, that's interesting behavior. So to get my mental notes on this straight:
The following triggers a rehash:
gem install foo-bar-with-executable
While the following command in a project with a Gemfile containing entry for gem foo-bar-with-executable
:
bundle install
will not then execute rehash and therefore foo-bar-with-executable
will not be available correctly?
I am a little bit confused as I have not yet had the need for bundler + rbenv combo,
is it regularly expected that bundle install would make foo-bar-with-executable
available on regular path with rbenv after a rehash?
A rewording or similar might be warranted though if it works for all but bundler environments.
from content.
Update: patch has been accepted and merged in rbenv/rbenv:master
so now this issue as initially described is accurate, assuming an up-to-date rbenv.
I'll caution that there hasn't been an "official" release of rbenv
in 2 years so it's likely only people who install via git will get it for a while (depending on the different package manager formulae definitions).
from content.
Thanks to you both, for helping with reviews, collaboration, and reporting/fixing the bug upstream. All of these contributions are very much appreciated.
from content.
Related Issues (20)
- Java: replace java-devel with java-openjdk-devel HOT 3
- start-hw: arduino about.md HOT 1
- RFE dotnet / dotnet-ide.md -- vscode rpm install HOT 1
- deployment: openshift about.md HOT 1
- : python django-installation.md HOT 1
- tech-database: mongodb about.md HOT 1
- : c gtk.md HOT 1
- tech-languages: rust rust-installation.md HOT 3
- : c cpp_installation.md HOT 5
- Refresh tech-languages: ruby ruby-installation.md HOT 1
- tech-database: sqlite about.md
- start-sw: web-app about.md
- rpmbuild may not download the source code if disable_source_fetch is defined. HOT 1
- RFE: references for ocaml dune.md HOT 4
- RFE: enhance python sphinx.md -- latexpdf HOT 1
- haskell.org/ghcup/ is recommended way to install since 2022 ("The Haskell Platform" is deprecated) HOT 1
- : vagrant vagrant-nfs.md sudoers configuration does not work (anymore) HOT 1
- Since `rbenv` is suggested for installing Ruby it could be nice at least mention `nodenv` HOT 1
- tech-languages: go go-installation.md HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from content.