Skip to content

Application templates broken #14054

j-osh opened this Issue Feb 14, 2014 · 2 comments

2 participants

j-osh commented Feb 14, 2014

Application templates are broken on master @ 7d897ab

Using the following template.rb...

def source_paths
ask("are we having fun yet?")
gem 'pry-rails'


rails new testapp -m template.rb


`source_paths': uninitialized constant Rails::Generators::AppBase::TemplateRecorder::File (NameError)


rails new testapp -n template.rb

Yields a new base rails app, but it doesn't add the specified gem and it doesn't stop to ask anything.

Also see: #13390

/cc @tenderlove

Ruby on Rails member

Can you show me exactly how you're running that command? I get a different error:

[aaron@higgins rails (master)]$ bundle exec railties/bin/rails new ~/git/testapp -m template.rb
       apply  /Users/aaron/git/rails/template.rb
  are we having fun yet? y
     gemfile    pry-rails
The template [/Users/aaron/git/rails/template.rb] could not be loaded. Error: No such file or directory @ rb_sysopen - /Users/aaron/git/testapp/Gemfile
[aaron@higgins rails (master)]$ 
@tenderlove tenderlove added a commit that closed this issue Feb 14, 2014
@tenderlove tenderlove remove railties changes. fixes #14054
Squashed commit of the following:

commit 96991e8e919edfb20cc4120bca4e36ed51175d57
Author: Aaron Patterson <>
Date:   Fri Feb 14 11:29:24 2014 -0800

    Revert "gems can be added or skipped from the template"

    This reverts commit 8beb42c.


commit 35599c0e657245ef14ac0f28c9189ad16acf40e6
Author: Aaron Patterson <>
Date:   Fri Feb 14 11:26:53 2014 -0800

    Revert "oops, template replay needs to happen after bundle. :orz:"

    This reverts commit 9104702.


commit f519c3902c313db8e906a49251c91643b8e6499e
Author: Aaron Patterson <>
Date:   Fri Feb 14 11:25:51 2014 -0800

    Revert "only ask for these ivars if the target responds to them"

    This reverts commit 656d412.

commit aa524a9428e3e4c45fe221f10a66a08efb827ab5
Author: Aaron Patterson <>
Date:   Fri Feb 14 11:25:39 2014 -0800

    Revert "refactor generator tests to use block form of Tempfile"

    This reverts commit 6525182.

commit 7d3740549fa4dfa62e3761f8d4bc6d6d441256e7
Author: Aaron Patterson <>
Date:   Fri Feb 14 11:25:25 2014 -0800

    Revert "add a more restricted codepath for templates fixes #13390"

    This reverts commit 2875b4a.

commit 525df0af1001918986cdfce59539fd2d52c4f32c
Author: Aaron Patterson <>
Date:   Fri Feb 14 11:25:11 2014 -0800

    Revert "add a send so `apply` can be called.  Fixes #13510"

    This reverts commit c5034d6.
j-osh commented Feb 14, 2014

on master @ 22a1a5a ...

I got (and still get) the output I specified above by building and installing the gem. When using the command from your comment things seem to work properly.

@tenderlove tenderlove added a commit that referenced this issue Feb 17, 2014
@tenderlove tenderlove Merge branch 'master' into adequaterecord
* master: (311 commits)
  Add a missing changelog entry for #13981 and #14035
  Revert "Fixed plugin_generator test"
  implements new option :month_format_string for date select helpers [Closes #13618]
  add factory methods for empty alias trackers
  guarantee a list in the alias tracker so we can remove a conditional
  stop exposing table_joins
  make most parameters to the AliasTracker required
  make a singleton for AssociationScope
  pass the association and connection to the scope method
  pass the tracker down the stack and construct it in the scope method
  clean up add_constraints signature
  remove the reflection delegate
  remove klass delegator
  remove railties changes. fixes #14054
  remove chain delegate
  remove scope_chain delegate
  Add verb to sanitization note
  fix path shown in mailer's templates
  updated Travis build status image url
  fix guide active_support_core_extensions. add Note to String#indent [ci skip]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.