Why is the build number included in auto-generated .rvmrc and .ruby-version files?

33 views
Skip to first unread message

Rob Nichols

unread,
Jul 16, 2013, 6:15:13 AM7/16/13
to rubyversi...@googlegroups.com
I find having the build number included in project rvm configurations files (.rvmrc and now .ruby-version) causes me more head-aches than any other rvm issue.

I first bumped my head on this one working with a colleague who was working on a mac, had a specific build of ruby that worked on macs (because the latest build didn't), and had booked .rvmrc into the repository. I didn't want to have install another version of ruby just to work on this project. Instead I deleted '-p<buildnumber>' portion of the gemset name from the .rvmrc and from then on the problem was sorted.

I've recently had to update rvm and ruby 1.9.3 on my system, and this build number issue has bit again. All my .rvmrc files (and the .ruby-version generated from them by 'rvm rvmrc to .ruby-version'), are now out of step with my new ruby build.  

It seems to me that the default configuration when you select ruby version within a project via either .rvmrc or .ruby-version, should be to use the current default build installed on the PC. That is, the config file should just have the ruby version and not the build. 

Being able to specify a particular build should be an option, I just don't think it should be the default option.

To clarify and using ruby 1.9.3 as an example, I think that the default format of .ruby-version should be:

ruby-1.9.3

and not 

ruby-1.9.3-p<buildno> 

mpapis

unread,
Sep 13, 2013, 11:42:03 AM9/13/13
to rubyversi...@googlegroups.com
this might get an option in rvm2 - for rvm1 we are feature freazed and will not change it

Andrew Premdas

unread,
Sep 14, 2013, 12:09:02 PM9/14/13
to rubyversi...@googlegroups.com
I consider .rvmrc files as something that should not be checked into a repository. Perhaps a solution would be to put a .rvmrc.sample in the repository instead. 

All best

Andrew

--
You received this message because you are subscribed to the Google Groups "rvm (Ruby Version Manager)" group.
 
Please visit http://rvm.io/ for documentation on rvm.
Please visit https://github.com/wayneeseguin/rvm/issues to see what is being worked on currently.
RVM2 The Plan: https://docs.google.com/document/d/1xW9GeEpLOWPcddDg_hOPvK4oeLxJmU3Q5FiCNT7nTAc/edit?usp=sharing
---
You received this message because you are subscribed to the Google Groups "RVM (Ruby Version Manager)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyversionmana...@googlegroups.com.
To post to this group, send email to rubyversi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
------------------------
Andrew Premdas

Rob Park

unread,
Sep 14, 2013, 3:38:54 PM9/14/13
to rubyversi...@googlegroups.com


On Saturday, September 14, 2013 12:09:02 PM UTC-4, apremdas wrote:



On 16 July 2013 11:15, Rob Nichols <r...@nicholshayes.co.uk> wrote:
I find having the build number included in project rvm configurations files (.rvmrc and now .ruby-version) causes me more head-aches than any other rvm issue.

I first bumped my head on this one working with a colleague who was working on a mac, had a specific build of ruby that worked on macs (because the latest build didn't), and had booked .rvmrc into the repository. I didn't want to have install another version of ruby just to work on this project. Instead I deleted '-p<buildnumber>' portion of the gemset name from the .rvmrc and from then on the problem was sorted.

I've recently had to update rvm and ruby 1.9.3 on my system, and this build number issue has bit again. All my .rvmrc files (and the .ruby-version generated from them by 'rvm rvmrc to .ruby-version'), are now out of step with my new ruby build.  

It seems to me that the default configuration when you select ruby version within a project via either .rvmrc or .ruby-version, should be to use the current default build installed on the PC. That is, the config file should just have the ruby version and not the build. 

Being able to specify a particular build should be an option, I just don't think it should be the default option.

To clarify and using ruby 1.9.3 as an example, I think that the default format of .ruby-version should be:

ruby-1.9.3

and not 

ruby-1.9.3-p<buildno> 


I consider .rvmrc files as something that should not be checked into a repository. Perhaps a solution would be to put a .rvmrc.sample in the repository instead. 

All best

Andrew

Andrew, do you check in a .ruby-version file? Or where else is the expected ruby contained?

I've been sticking with .rvmrc (and committing it) because RubyMine will detect and switch automatically when changing projects. It doesn't seem aware of .ruby-version yet.

Should I be changing that practice?

Thanks.

@robpark 

Andrew Premdas

unread,
Sep 15, 2013, 9:51:01 PM9/15/13
to rubyversi...@googlegroups.com
I don't check in a .rvmrc or .ruby-version. I consider these files are for allowing 'developers' to choose which version of ruby they want to use locally for the application. Developers should have the freedom to choose any suitable Ruby and that Ruby should not be changed by commits that other users in team may make. The most I would do is put a '.sample' file in the repo, and perhaps mention this in the `developer_readme`. Some of your team may want to use other mechanisms for switching rubies. Others might want to use Rubies that are optimised for testing etc etc.

Production ruby setup and testing should (IMO) be done by different mechanisms. Perhaps indicating the preferred Ruby in a deploy script and use that ruby in CI. 

HTH

Andrew

--
You received this message because you are subscribed to the Google Groups "rvm (Ruby Version Manager)" group.
 
Please visit http://rvm.io/ for documentation on rvm.
Please visit https://github.com/wayneeseguin/rvm/issues to see what is being worked on currently.
RVM2 The Plan: https://docs.google.com/document/d/1xW9GeEpLOWPcddDg_hOPvK4oeLxJmU3Q5FiCNT7nTAc/edit?usp=sharing
---
You received this message because you are subscribed to the Google Groups "RVM (Ruby Version Manager)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyversionmana...@googlegroups.com.
To post to this group, send email to rubyversi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Rob Park

unread,
Sep 16, 2013, 7:17:10 AM9/16/13
to rubyversi...@googlegroups.com
On Mon, Sep 16, 2013 at 3:51 AM, Andrew Premdas <apre...@gmail.com> wrote:



On 14 September 2013 20:38, Rob Park <robert...@gmail.com> wrote:


On Saturday, September 14, 2013 12:09:02 PM UTC-4, apremdas wrote:



On 16 July 2013 11:15, Rob Nichols <r...@nicholshayes.co.uk> wrote:
I find having the build number included in project rvm configurations files (.rvmrc and now .ruby-version) causes me more head-aches than any other rvm issue.

I first bumped my head on this one working with a colleague who was working on a mac, had a specific build of ruby that worked on macs (because the latest build didn't), and had booked .rvmrc into the repository. I didn't want to have install another version of ruby just to work on this project. Instead I deleted '-p<buildnumber>' portion of the gemset name from the .rvmrc and from then on the problem was sorted.

I've recently had to update rvm and ruby 1.9.3 on my system, and this build number issue has bit again. All my .rvmrc files (and the .ruby-version generated from them by 'rvm rvmrc to .ruby-version'), are now out of step with my new ruby build.  

It seems to me that the default configuration when you select ruby version within a project via either .rvmrc or .ruby-version, should be to use the current default build installed on the PC. That is, the config file should just have the ruby version and not the build. 

Being able to specify a particular build should be an option, I just don't think it should be the default option.

To clarify and using ruby 1.9.3 as an example, I think that the default format of .ruby-version should be:

ruby-1.9.3

and not 

ruby-1.9.3-p<buildno> 


I consider .rvmrc files as something that should not be checked into a repository. Perhaps a solution would be to put a .rvmrc.sample in the repository instead. 

All best

Andrew

Andrew, do you check in a .ruby-version file? Or where else is the expected ruby contained?

I've been sticking with .rvmrc (and committing it) because RubyMine will detect and switch automatically when changing projects. It doesn't seem aware of .ruby-version yet.

Should I be changing that practice?

Thanks.

@robpark 

I don't check in a .rvmrc or .ruby-version. I consider these files are for allowing 'developers' to choose which version of ruby they want to use locally for the application. Developers should have the freedom to choose any suitable Ruby and that Ruby should not be changed by commits that other users in team may make. The most I would do is put a '.sample' file in the repo, and perhaps mention this in the `developer_readme`. Some of your team may want to use other mechanisms for switching rubies. Others might want to use Rubies that are optimised for testing etc etc.

That's interesting and to the extent I'm just using it for IDE "notification" that's certainly what I do with other IDE specific files (ignore them). 

Production ruby setup and testing should (IMO) be done by different mechanisms. Perhaps indicating the preferred Ruby in a deploy script and use that ruby in CI. 

The part of this I need to do some more thinking about is trying to reduce dev-prod system parity and whether or not that applies here.

HTH

Andrew

Thanks.

@rob 

Reply all
Reply to author
Forward
0 new messages