I18N lazy lookup

ruby /home/rubys/git/rails/railties/bin/rails testapp --dev
      create  
      create  README
      create  .gitignore
      create  Rakefile
      create  config.ru
      create  Gemfile
      create  app
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/models
      create  app/views/layouts
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/test.rb
      create  config/environments/production.rb
      create  config/environments/development.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/cookie_verification_secret.rb
      create  config/initializers/inflections.rb
      create  config/initializers/session_store.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  log
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log
      create  public
      create  public/422.html
      create  public/404.html
      create  public/robots.txt
      create  public/500.html
      create  public/index.html
      create  public/favicon.ico
      create  public/images
      create  public/images/rails.png
      create  public/stylesheets
      create  public/stylesheets/.gitkeep
      create  public/javascripts
      create  public/javascripts/controls.js
      create  public/javascripts/application.js
      create  public/javascripts/prototype.js
      create  public/javascripts/effects.js
      create  public/javascripts/dragdrop.js
      create  script
      create  script/dbconsole
      create  script/generate
      create  script/performance/profiler
      create  script/performance/benchmarker
      create  script/console
      create  script/runner
      create  script/about
      create  script/plugin
      create  script/destroy
      create  script/server
      create  test
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  test/unit
      create  test/fixtures
      create  test/functional
      create  test/integration
      create  tmp
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
gem bundle
Calculating dependencies...
Updating source: http://gems.rubyforge.org
Downloading abstract-1.0.0.gem
Downloading arel-0.2.pre.gem
Downloading erubis-2.6.5.gem
Downloading i18n-0.3.3.gem
Downloading mail-1.5.2.gem
Downloading mime-types-1.16.gem
Downloading rack-1.1.0.gem
Downloading rack-mount-0.4.2.gem
Downloading rack-test-0.5.3.gem
Downloading rake-0.8.7.gem
Installing i18n (0.3.3)
Installing arel (0.2.pre)
Installing rack (1.1.0)
Installing rack-test (0.5.3)
Installing rack-mount (0.4.2)
Installing abstract (1.0.0)
Installing erubis (2.6.5)
Installing mime-types (1.16)
Installing mail (1.5.2)
Installing rake (0.8.7)
Done.
ruby script/generate scaffold product title:string
      invoke  active_record
      create    db/migrate/20100109205352_create_products.rb
      create    app/models/product.rb
      invoke    test_unit
      create      test/unit/product_test.rb
      create      test/fixtures/products.yml
       route  resources :products
      invoke  scaffold_controller
      create    app/controllers/products_controller.rb
      invoke    erb
      create      app/views/products
      create      app/views/products/index.html.erb
      create      app/views/products/edit.html.erb
      create      app/views/products/show.html.erb
      create      app/views/products/new.html.erb
      create      app/views/products/_form.html.erb
      create      app/views/layouts/products.html.erb
      invoke    test_unit
      create      test/functional/products_controller_test.rb
      invoke    helper
      create      app/helpers/products_helper.rb
      invoke      test_unit
      create        test/unit/helpers/products_helper_test.rb
      invoke  stylesheets
      create    public/stylesheets/scaffold.css
rake db:migrate
mv 20100109205352_create_products.rb 20100301000001_create_products.rb
(in /home/rubys/tmp/work/testapp)
==  CreateProducts: migrating =================================================
-- create_table(:products)
   -> 0.0037s
==  CreateProducts: migrated (0.0039s) ========================================
 
edit config/locales/en.yml
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
 
en:
  products:
    index:
      hello: "Hello world!"
edit app/views/products/index.html.erb
<h1>Listing products</h1>
 
<table>
  <tr>
    <th>Title</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>
 
<% @products.each do |product| %>
  <tr>
    <td><%= product.title %></td>
    <td><%= link_to 'Show', product %></td>
    <td><%= link_to 'Edit', edit_product_path(product) %></td>
    <td><%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>
 
<br />
 
<%= link_to 'New product', new_product_path %>
 
<p class="hello"><%= t('.hello') %></p>

Start the server.

get /products

NoMethodError in Products#index

Showing /home/rubys/tmp/work/testapp/app/views/products/index.html.erb where line #25 raised:

undefined method `path_without_format_and_extension' for nil:NilClass

Extracted source (around line #25):

22: 
23: <%= link_to 'New product', new_product_path %>
24: 
25: <p class="hello"><%= t('.hello') %></p>

Rails.root: /home/rubys/tmp/work/testapp

Application Trace | Framework Trace | Full Trace

Request

Parameters:

None

Show session dump

Response

Headers:

None

Environment

Sat, 09 Jan 2010 20:54:02 GMT
/home/rubys/.rvm/ruby-1.8.7-p248/bin/ruby -v
ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux]
gem -v
1.3.5
gem list
abstract (1.0.0)
activesupport (2.3.5)
builder (2.1.2)
bundler (0.7.2)
erubis (2.6.5)
gorp (0.15.0)
htmlentities (4.2.0)
i18n (0.3.2)
mail (1.5.0)
mime-types (1.16)
rack (1.0.1)
rack-mount (0.4.0)
rack-test (0.5.3)
rake (0.8.7)
rdoc (2.4.3)
sqlite3-ruby (1.2.5)
test-unit (2.0.5)
tzinfo (0.3.15)
will_paginate (2.3.11)
echo $RUBYLIB | sed "s/:/\n/g"
/home/rubys/git/gorp/lib
/home/rubys/git/arel/lib
/home/rubys/git/rack/lib
ruby /home/rubys/git/rails/railties/bin/rails -v
Rails 3.0.pre
git log -1
commit d2c4a93c6966cb06d6029f9f4dbe5f71a52a02db
Author: David Heinemeier Hansson <david@loudthinking.com>
Date:   Sat Jan 9 09:52:16 2010 -0800

    Have to remove the environment name from ARGV or IRB will freak out