Reputation: 3139
I want to make some tiny patches to Ruby on Rails. Previously I've directly edited the gems installed in my machine (e.g. \ruby\gems\2.0.0\gems\activerecord-4.2.0
), while knowing it would be a pretty bad way. And I'm still not sure how to tweak, test and run the framework efficiently, even after walking through Rails Guide and rails-dev-box
What's the concept of rails-dev-box is? Is it just supposed to bring a way to run a minitest via in the environment that the Rails core team also uses? Are we supposed to modify/add/delete codes, write a test corresponding the change in the host machine, and then run the test in the guest machine?
It even doesn't have Rails at all, so while it claims an app running in the guest machine can be accessed from the host machine, we even can't make and run a Rails app without manually installing it from somewhere.
The workflow I'd rather expect was...
and the rails-dev-box seems to lack the 3rd condition, unless I'm missing something...
I know we can specify the location of Rails itself in Gemfile, like
gem 'rails', :path => '/vagrant/rails'
But not certain that's the workaround (at least, I can't test the rails app generator by my codes).
Upvotes: 0
Views: 58
Reputation: 27961
What's the concept of rails-dev-box is?
To provide a common base for everyone developing for Rails that includes all the databases, ruby, execjs, etc.
Is it just supposed to bring a way to run a minitest via in the environment that the Rails core team also uses?
Yes, as well as the other dependencies needed for testing your changes properly. Prior to this dev box build many MANY pull requests had to be rejected because the author hadn't tested thoroughly eg. because they didn't have one of the DB engines installed, or had an older version of ruby. This dev box gives a standard environment that the Rails core team keeps up to date.
Are we supposed to modify/add/delete codes, write a test corresponding the change in the host machine, and then run the test in the guest machine?
Yes, as detailed here on the dev box README you linked to in your question.
It even doesn't have Rails at all.
No, of course not, otherwise you'd have to use the VM's editing tools to edit your code, this is also covered in great detail here in the dev box README that you linked to in your question. It has step by step instructions on cloning your fork of rails, and what the VM does to map that volume etc.
Run the framework based on the code I've just edited.
Based on your comment about the Gemfile I'm guessing that you wanted to create a Rails app based on your changes? You can, of course, do this if you wish - just as you've detailed with the :path
option (that is the way to do what you want), but this is not a normal process.
Upvotes: 2