Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Add support for a default-gems file #31

Closed
Stratus3D opened this issue Mar 25, 2017 · 4 comments
Closed

[Proposal] Add support for a default-gems file #31

Stratus3D opened this issue Mar 25, 2017 · 4 comments

Comments

@Stratus3D
Copy link
Member

I came across this article about the default-gems feature in rbenv: https://philna.sh/blog/2017/03/22/always-install-bundler-alongside-ruby-with-rbenv/ Might be a nice feature to add to asdf-ruby at some point. Not a high priority but definitely could be nice to have.

If anyone wants to contribute to asdf-ruby I think this might be an easy way to start. This feature should be relatively easy to implement:

  • After installation of a ruby version, add some code to the install gems.
  • The code should look for a file, say .default-gems in the user's home directory.
  • Iterate over each line of the file, taking the text on the line and using it as the gem name in a gem install $gem command. Make sure to check the exit code and print an appropriate error message if a gem install fails. It may be possible to pass all the gems to gem install at once, I'm not familiar with the input gem install will accept.
thiagoa added a commit to thiagoa/asdf-ruby that referenced this issue Apr 24, 2017
thiagoa added a commit to thiagoa/asdf-ruby that referenced this issue Apr 24, 2017
thiagoa added a commit to thiagoa/asdf-ruby that referenced this issue Apr 24, 2017
@Stratus3D
Copy link
Member Author

@thiagoa it looks like gem install isn't executed with the newly installed version of Ruby. Rather than try to set the version in a subshell it might be easier just to specify the full path to gem since we already have the path in $ASDF_INSTALL_PATH.

@thiagoa
Copy link
Contributor

thiagoa commented Apr 29, 2017

@Stratus3D I opened another PR to fix it up. Sorry for the hassle!

@breunigs
Copy link
Contributor

I think the desired functionality is there – I tested it today and it works as one would expect. Can this be closed?

@Stratus3D
Copy link
Member Author

@breunigs thanks. Yes everything should be there now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants