-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adjust setup to new Ruby and asdf #297
Conversation
* Run `gem install bundler` to install Bundler. | ||
You may have it already installed, but this command will make sure that you have the latest version. | ||
* Run `gem update --system` to update Ruby's default gems (e.g. `bundler`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bundler
is a default gem sind Ruby 2.6.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
ruby_on_rails/app_initialisation.md
Outdated
@@ -19,14 +15,21 @@ You can do this with `gem update rails`. Beware of beta versions. | |||
You may want to choose a different database from Postgres, but most of the time that will be your choice. | |||
If you do not need a DB you may rethink the fact that you may not need Rails at all :) Take a look at [Sinatra](http://www.sinatrarb.com/) or [Angular](https://angular.io/) | |||
|
|||
* Switch your local Ruby to the fresh one: `asdf local ruby latest` to populate a `.tool-versions` file | |||
and delete any `.ruby-version` or `.nvmrc` files generated by Rails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails setups should not generate .nvmrc
files. I still leave the hint.
ruby_on_rails/app_initialisation.md
Outdated
* Load the Ruby version automatically in the fresh project's `Gemfile` by adding this: | ||
|
||
```ruby File.read(File.join(__dir__, '.ruby-version'))``` | ||
```rb | ||
ruby File.read(File.join(__dir__, '.tool-versions'))[/ruby\s(.*)/, 1].strip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about completely dropping this and replacing it by
ruby '~> 3.1.0'
since patch level updates never were a problem since Ruby 1.9.3. But I then thought, that we always want to go through the CI on a version change. So I now read the more complicated .tool-versions
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Heroku and Semaphore are ok, I am ok 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, There'd also be a way to configure asdf to use the .ruby-version
file:
https://github.com/asdf-vm/asdf-ruby#migrating-from-another-ruby-version-manager
Still using .ruby-version
maybe is easier since Heroku etc. already know it (maybe they also look at .tool-versions, I haven't checked 🤷). But it would reduce the complexity of that line for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukasbischof the assumption that Heroku knows about it is wrong. Heroku looks at the Gemfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to be honest: switching away from standards "ruby-version" and "nvmrc" to go towards an asdf
specific format, still does not convince me fully. I didn't find in the protocol why we decided in favour of that: https://docs.google.com/document/d/1kqig4ITDiSciXu6mGtIg8b0bUsqQXjNl8De6gu5Y3Hg/edit#heading=h.22jutnjr8ybt
Maybe we could have it documented there?
ruby_on_rails/app_initialisation.md
Outdated
* Load the Ruby version automatically in the fresh project's `Gemfile` by adding this: | ||
|
||
```ruby File.read(File.join(__dir__, '.ruby-version'))``` | ||
```rb | ||
ruby File.read(File.join(__dir__, '.tool-versions'))[/ruby\s(.*)/, 1].strip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Heroku and Semaphore are ok, I am ok 👍
Question: why not using asdf and keep the ruby-version and nvmrc files? 🤔 |
Why would you not want to have a single file with all virtual env dependencies in it? |
There are two arguments against using
So I roll-back this part. Still nothing speaks against using |
It's a bit annoying that they call it |
Yes it makes you feel bad for using it 😉 Edit: Rust had something similar: A lint called |
No description provided.