Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] AppGenerator fails when using --pretend option

#5245

I'm not sure if this is definitely an issue with rails or a recent change to thor, but I noticed that when running rails new myapp --pretend, I received an error:

ree(1.8.7@rails3rc) blakey:~ $ rails new myapp --pretend
      create  
/Users/steve/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/fileutils.rb:121:in `chdir': No such file or directory - /Users/steve/myapp (Errno::ENOENT)
    from /Users/steve/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/fileutils.rb:121:in `cd'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/railties-3.0.0.rc/lib/rails/generators/rails/app/app_generator.rb:219:in `create_root'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/task.rb:22:in `send'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/task.rb:22:in `run'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/invocation.rb:124:in `invoke_all'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/shell.rb:14:in `map'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/core_ext/ordered_hash.rb:73:in `each'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/invocation.rb:124:in `map'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/invocation.rb:124:in `invoke_all'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/group.rb:226:in `dispatch'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/thor-0.14.0/lib/thor/base.rb:389:in `start'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/railties-3.0.0.rc/lib/rails/commands/application.rb:18
    from /Users/steve/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /Users/steve/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/railties-3.0.0.rc/lib/rails/cli.rb:12
    from /Users/steve/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /Users/steve/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/gems/rails-3.0.0.rc/bin/rails:4
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/bin/rails:19:in `load'
    from /Users/steve/.rvm/gems/ree-1.8.7-2010.01@rails3rc/bin/rails:19

I've fixed the app generator so that it works as expected now.

Reported by Steve Agalloco · July 30th, 2010 @ 03:44 AM

State: committed
Milestone: none
Assigned to: Santiago Pastorino Santiago Pastorino
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • Assigned user set to Santiago Pastorino
    • State changed from new to open
    • Importance changed from to Low

    Issue confirmed. Patch looks good, fixed the problem.

    July 30th, 2010 @ 04:59 AM

  2. Repository
    Repository
    • State changed from open to committed

    (from [b823e50a54156f688dd0892e7a8671b730814bc6]) fix for rails app generator when using --pretend option

    [#5245 state:committed]

    Signed-off-by: Santiago Pastorino santiago@wyeworks.com
    http://github.com/rails/rails/commit/b823e50a54156f688dd0892e7a8671...

    July 30th, 2010 @ 03:56 PM