0

In another question (Why does the Rails command force a help message for the new command?), I found that Rails needs the rails script to be in the script folder, in the root of my project, in order for it to be properly detected as an existing Rails projects, and allow me to use the various rails commands other then new.

I did this because I felt that the more popular moniker for including executable content in a repository to highlight available use cases is by using the name scripts. At least the pluralism in English should be appreciated!

Is there anyway to change which folder the main Rails executable looks for the project-included one?

I actually think it's a bit silly to include this rails executable in the project, and can be redundant. Maybe it's for customization, but I feel that could better be done in the configuration, environment, other .rb files. So also, could this just be removed somehow, and still have a functioning project through varied use of the main rails command.

Community
  • 1
  • 1
Pysis
  • 1,452
  • 2
  • 17
  • 31
  • Did you know that the rails server (ie what actually runs, when you run your app) is in that folder... you kinda need that in order for your website to do what it needs to do (load your models, etc, run the code in the controller, access the db etc). If you don't want it literally in your deploy folder, you can install that folder somewhere else and then symlink it from your web app... but really, yes you do need it. – Taryn East Aug 12 '16 at 03:38
  • I see that point, but Rails has such a framework and layout for your project, I don't see why it has to only rely on the executable being in your project. Just keep that code in the main executable to 'generally' load those sorts of things, and if you need anything else customized, just include that in the 'configuration' `.rb` files that Rails is already full of and automatically loads, such as the various environment files, `test_helper.rb`, we even have the `boot.rb` and `application.rb` 'core' files that gets loaded automatically as well, and that logic could also simply be put elsewhere. – Pysis Aug 12 '16 at 13:15
  • My end goal is to simply not have a `script` folder in my project. I don't agree with the semantics of it, and it also prolongs my tab completion when having both folders exist :). I just don't see why we wouldn't be able to achieve this effect, when Rails is already so configurable with magic mixins at almost every step of their framework. – Pysis Aug 12 '16 at 13:16
  • RoR is open-source... fork it on github and make the changes you want... :D If you do it well, then make a PR and it could get pulled back into master and we can all be `script`-free :D – Taryn East Aug 14 '16 at 23:08

0 Answers0