Ruby on Rails
Wednesday, March 11, 2015
well, if that snippet is all you want, you can just
-- cat $(bundle show rails)/railties/lib/rails/all.rb
and copy whatever you need to your config/application.rb
On Tuesday, March 10, 2015 at 11:54:08 AM UTC+2, Eliot Sykes wrote:
On Tuesday, March 10, 2015 at 11:54:08 AM UTC+2, Eliot Sykes wrote:
Hi all,I've been trying to find out if Rails 4.2 provides a single command that regenerates config/application.rb in an existing application.I'm trying to find something more lightweight than running 'rails new MyApp' in a new directory and copying over the file.The reason I ask is imagine a Rails app is 'rails new'-ed without the --skip-test-unit option.Then at a much later date, this app is switched to RSpec. Can config/application.rb be regenerated as if the --skip-test-unit option had been supplied originally to 'rails new ...'?All this would effectively do is change the require statements near the top of config/application.rb file from:require 'rails/all'to:# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
It's possible to get part of the way there with this command:bin/rake rails:update:configsWhich asks if you want to overwrite config/application.rb and generates a new copy. However, I've not been successful in getting that command to make use of the --skip-test-unit option. I've tried variations on this without luck:bin/rake rails:update:configs[--skip-test -unit]Many thanks in advance for any help,Eliot
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5d494fca-d092-4287-8f31-8a4072e5b249%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment