-
Notifications
You must be signed in to change notification settings - Fork 301
Open
Labels
Description
I've been playing with rails_apps_composer, but one thing seemed different from my existing workflow. I tend to keep my global rvm gemset very bare (including without rails) and usually have the following process for a new application:
- create application specific gemset
- switch to application specific gemset
- add .rvmrc file with application specific gemset
- install the rails gem
- proceed...
But, the rvmrc recipe in rails_apps_composer occurs after "rails new" is run, requiring rails to be installed already (and into the global gemset). Maybe my approach is more unusual, but I wonder if there might not be some general use for a before_everything stage where some very initial setup could occur?
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
AJ-Acevedo commentedon Feb 6, 2013
Where do you save the .rvmrc file before your rails app is created? Adding rails to the app gemset would also add a substantial amount of time to the initial setup time.
DanielKehoe commentedon Feb 6, 2013
Yes, @travisp, please clarify.
My workflow is:
How do you manage the .rvmrc file before the app is created?
travisp commentedon Feb 7, 2013
To clarify my steps: the .rvmrc file is created in the new target application directory, and rails new is simply run with "rails new ." -- I guess I was leaving out that I create the application directory first too. In rails_apps_composer's case, the new application directory could be created, .rvmrc stuck into it, and then run rails new and install into the same new directory (it won't touch the existing rvmrc).
However, when the rvmrc file is created (my step 3) is less important because it could also be created later in my workflow. The main point of what I wanted to do was to enable rails_apps_composer to perform steps 1-3 of @DanielKehoe's workflow, since these are part of the steps every time anyway. The current rvmrc recipe performs steps 1-2 at the end, which doesn't make nearly as much sense to me (and presumably still also needs to install rails into the newly created gemset).
Adding rails to the app gemset does take time (less if you use "--no-ri --no-rdoc"), but it has to be done anyways with my or @DanielKehoe's workflow. So, it wouldn't actually take any additional time unless you're constantly rerunning rails_apps_composer
If this isn't generally wanted in the project I'll probably just create my own wrapper script to replace the use of the rvmrc recipe and perform the initial steps of the workflow before calling rails_apps_composer.
DanielKehoe commentedon Feb 7, 2013
@travisp this is very interesting. First time I've seen the suggestion to make a directory and then run 'rails new .' Clever. I'm intrigued by the possibility of reworking r_a_c in this direction. A few reservations, though. Not everyone wants to use rvm, some use rbenv. And I'm told rvm and rbenv may become superfluous with the release of Rails 4. I don't want to rework r_a_c to become dependent on rvm. I'll investigate further as I have time.
DanielKehoe commentedon Feb 7, 2013
So @travisp taught me something new today, thanks!
Here's my new workflow for creating a Rails app using rvm (simple case):
Here's the new workflow using the current version of r_a_c with rvm:
In this case, it makes no difference if you answer 'yes' when r_a_c asks if you want to create a project-specific gemset and .rvmrc (you already have both so it continues without error).
Here's a proposed workflow using a hypothetical future version of r_a_c:
We'd give r_a_c a new flag
--rvm
to direct it to create a project-specific gemset and .rvmrc before running the application template. Alternatively, we could detect if rvm is running (so we wouldn't need the flag).I'm not convinced of the value of the proposed approach. It saves two manual steps but it requires installing the rails_apps_composer gem in the global gemset.
One side benefit might be eliminating the problems caused by people running r_a_c with stale gems (issue #148). But it only helps if rvm is installed.
Further thoughts?
travisp commentedon Feb 7, 2013
It does have some value to me (although admittedly nothing I can't manage manually or with a wrapper script) and I suppose having to install r_a_c in the global (or other individual) gemset has its own set of advantages/disadvantages.
I'm unfamiliar with the proposed changes to Rails 4 that might make rvm superfluous. If that's actually the case, I would agree that it's not worth the effort.
Maybe it would be best to wait and see if others would also find this valuable if it's not a trivial amount of changes.
AJ-Acevedo commentedon Feb 7, 2013
@DanielKehoe Do you have a link to the proposed changes to Rails 4 that might make rvm superfluous?
DanielKehoe commentedon Feb 7, 2013
@AJ-Acevedo My comment about "changes in Rails 4 that might make rvm superfluous" is conjecture based on comments from someone working on Bundler. So nothing substantial.
DanielKehoe commentedon Feb 20, 2013
I've released a new version of rails_apps_composer and the Rails Composer application template that detects if the .rvmrc file already exists and only asks if you want to create a gemset and .rvmrc file if the .rvmrc file doesn't exist.
This doesn't implement @travisp's request but it prevents the display of the "create .rvmrc?" question in his workflow.