Giter Site home page Giter Site logo

: web-app rails.md about content HOT 10 CLOSED

dirschn avatar dirschn commented on July 21, 2024
: web-app rails.md

from content.

Comments (10)

benmelz avatar benmelz commented on July 21, 2024 1

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.

benmelz avatar benmelz commented on July 21, 2024 1

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.

jackorp avatar jackorp commented on July 21, 2024 1

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.

jackorp avatar jackorp commented on July 21, 2024 1

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.

dirschn avatar dirschn commented on July 21, 2024 1

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.

jackorp avatar jackorp commented on July 21, 2024

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.

dirschn avatar dirschn commented on July 21, 2024

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.

jackorp avatar jackorp commented on July 21, 2024

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.

benmelz avatar benmelz commented on July 21, 2024

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.

jackorp avatar jackorp commented on July 21, 2024

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)

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.