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.

rake rails:update replaces application name

#5207

Running 'rake rails:update' after updating to 3.0.0.rc will replace the application name in many config files (such as application.rb, environment.rb, development.rb, production.rb, test.rb) with 'Config'.

Reported by Pablo Borges · July 27th, 2010 @ 05:16 AM

State: committed
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: High

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • Milestone cleared.
    • State changed from new to open
    • Assigned user set to José Valim
    • Tag changed from rake tasks, 3.0.0.rc to rake tasks, 3.0.0.rc, generators
    • Importance changed from to High

    Confirmed that the issue exists.

    I couldn't determine exactly why it's happening but this what I found —

    I added some put statements in app_generator.rb

          def app_name
            puts "destination_root is #{destination_root}"
            @app_name ||= File.basename(destination_root)
          end
    
          def app_const_base
            puts "app_name is #{app_name}"  
            @app_const_base ||= app_name.gsub(/\W/, '_').squeeze('_').camelize
          end
    

    Created a Rails 3 Beta 4 app, updated the Gemfile to use Rails 3 RC, switched to Rails 3 RC gemset (using RVM) and ran rake rails:update which gave the following output —

    Note: I have separated out the important part with newlines and a comment.

    (ruby-1.9.2@rails)(~/bugmash/beta4app)९ rake rails:update
    (in /home/rohit/bugmash/beta4app)
    destination_root is /home/rohit/bugmash/beta4app
    app_name is beta4app
    destination_root is /home/rohit/bugmash/beta4app
    Beta4app::Application
       identical  config/boot.rb
           exist  config
    
    
    ## Because destination root is ./config app name is also config!
    destination_root is /home/rohit/bugmash/beta4app/config
    app_name is config
    destination_root is /home/rohit/bugmash/beta4app/config
    
    
        conflict  config/routes.rb
    Overwrite /home/rohit/bugmash/beta4app/config/routes.rb? (enter "h" for help) [Ynaqdh] a
           force  config/routes.rb
    destination_root is /home/rohit/bugmash/beta4app/config
    app_name is config
        conflict  config/application.rb
           force  config/application.rb
        conflict  config/environment.rb
           force  config/environment.rb
           exist  config/environments
        conflict  config/environments/production.rb
           force  config/environments/production.rb
        conflict  config/environments/test.rb
           force  config/environments/test.rb
        conflict  config/environments/development.rb
           force  config/environments/development.rb
           exist  config/initializers
       identical  config/initializers/backtrace_silencers.rb
        conflict  config/initializers/secret_token.rb
           force  config/initializers/secret_token.rb
        conflict  config/initializers/inflections.rb
           force  config/initializers/inflections.rb
    destination_root is /home/rohit/bugmash/beta4app/config
        conflict  config/initializers/session_store.rb
           force  config/initializers/session_store.rb
       identical  config/initializers/mime_types.rb
           exist  config/locales
       identical  config/locales/en.yml
           exist  public/javascripts
       identical  public/javascripts/application.js
       identical  public/javascripts/controls.js
        conflict  public/javascripts/prototype.js
           force  public/javascripts/prototype.js
       identical  public/javascripts/dragdrop.js
       identical  public/javascripts/effects.js
        conflict  public/javascripts/rails.js
           force  public/javascripts/rails.js
           exist  script
       identical  script/rails
    

    I didn't know exactly how to proceed further but I did one last thing — I added a puts caller if app_name == 'config' in the app_const_base method and got the output —> http://pastie.org/1061691

    I hope this helps somebody go further. Also I've given the issue a High priority since many people will be upgrading their beta apps to RC.

    July 27th, 2010 @ 06:53 AM

  2. Rohit Arondekar
    Rohit Arondekar

    Attached is a patch that fixes this.

    July 27th, 2010 @ 10:30 AM

  3. Repository
    Repository
    • State changed from open to committed

    (from [5d3e8ee2bdd2225fe6e610c7e465bb69234871ed]) Fix app generator so that it uses the right app_name during rails:update rake task. [#5207 rake rails:update replaces application name state:committed]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/5d3e8ee2bdd2225fe6e610c7e465bb...

    July 27th, 2010 @ 10:35 AM

  4. Jeremy Kemper
  5. Uggbottes
    Uggbottes

    LISA One of the most important supplies [url=http://www.bottes-ugg-bottes.com/bottes-ugg-classic-bottes-ugg-clas...] Bottes Ugg Mini Classic [/url]
    that you must have is the bee suit. You need to wear this every time you will go near the bees because miu miu [url=http://www.bottes-ugg-bottes.com/bottes-ugg-classic-bottes-ugg-clas...] Classic Bottes Ugg [/url]
    sale this will serve as your protection against their stings. This bee suit must be made of very special materials so that you will be sure that you chanel [ur l=http://www.bottes-ugg-bottes.com/bottes-ugg-button-bailey-bottes-ug...] Bottes Ugg Belgique [/url]are protected when you are doing [url=http://www.bottes-ugg-bottes.com/bottes-ugg-button-bailey-bottes-ug...] Bottes Ugg Australia [/url]

    January 12th, 2011 @ 03:45 AM

  6. Uggbottes
    Uggbottes

    Bottes Ugg France Bottes Ugg Hiver could be the first shoes in the world to come with instructions on how to use them. Nike Air Jordan High Strap
    Nike Air Jordan Retro High PremieNike Air Jordan Phatmost outlets provide specialist advice on walking properly. short rapid steps, landing on the heel or masai sensor
    region before rolling towards the toe, is Tiffany Colliers TFNL839 Tiffany Heart Tag Pendant Tiffany Heart Tag Pendant Collier outlet the way forward. exercises include floating, Nouvelle Moncler StorePrintemps Nouvelle Moncler DoudouneAuthentique Bottes Monclera near jog closely resembling that slightly ridiculous gait employed by olympic walkers.

    January 12th, 2011 @ 05:55 AM