Movies II part 5/7 step 3


#1

When I try to run my code, I get this error:

undefined method 'name' for nil:NilClass

As far as I can tell, this appeared in part 3/7 when I ran rake db:seed, by which I mean it said something about it in the console, and then let me continue to part 4/7.

The problem is, now I can't complete part 5/7 because of it.

Here's a copy of the console:

$ bundle exec rake db:seed
/home/ccuser/.gem/ruby/2.3.0/gems/activesupport-4.1.1/lib/act
ive_support/values/time_zone.rb:285: warning: circular argume
nt reference - now
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_association.rb:74: warning: c
ircular argument reference - reflection
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_association.rb:78: warning: c
ircular argument reference - reflection
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_association.rb:82: warning: c
ircular argument reference - reflection
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_association.rb:101: warning:
circular argument reference - reflection
rake aborted!
NoMethodError: undefined method 'name' for nil:NilClass
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_association.rb:79:in 'cached_
counter_attribute_name'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_association.rb:75:in 'has_cac
hed_counter?'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_association.rb:83:in 'update_
counter'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_through_association.rb:65:in
'insert_record'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:522:in 'bloc
k (2 levels) in concat_records'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:389:in 'add_
to_target'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:521:in 'bloc
k in concat_records'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:519:in 'each
'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:519:in 'conc
at_records'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_through_association.rb:42:in
'concat_records'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:153:in 'bloc
k in concat'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:168:in 'bloc
k in transaction'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/database_statements.rb
:211:in 'block in transaction'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/database_statements.rb
:219:in 'within_new_transaction'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/database_statements.rb
:211:in 'transaction'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/transactions.rb:208:in 'transaction'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:167:in 'tran
saction'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_association.rb:153:in 'conc
at'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/has_many_through_association.rb:36:in
'concat'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/associations/collection_proxy.rb:968:in '<<'
/home/ccuser/workspace/learn-rails-many-to-many/db/seeds.rb:5
2:in ''
/home/ccuser/.gem/ruby/2.3.0/gems/activesupport-4.1.1/lib/act
ive_support/dependencies.rb:241:in 'load'
/home/ccuser/.gem/ruby/2.3.0/gems/activesupport-4.1.1/lib/act
ive_support/dependencies.rb:241:in 'block in load'
/home/ccuser/.gem/ruby/2.3.0/gems/activesupport-4.1.1/lib/act
ive_support/dependencies.rb:232:in 'load_dependency'
/home/ccuser/.gem/ruby/2.3.0/gems/activesupport-4.1.1/lib/act
ive_support/dependencies.rb:241:in 'load'
/home/ccuser/.gem/ruby/2.3.0/gems/railties-4.1.1/lib/rails/en
gine.rb:543:in 'load_seed'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/tasks/database_tasks.rb:184:in 'load_seed'
/home/ccuser/.gem/ruby/2.3.0/gems/activerecord-4.1.1/lib/acti
ve_record/railties/databases.rake:173:in 'block (2 levels) in
'
Tasks: TOP => db:seed
(See full trace by running task with --trace)

And here's my code for app/view/movies/show.html.erb:

<div class="main movie-show">
  <div class="container">
    <div class="movie">
      
      <!-- Display the movie's info here -->
      <div class="info">
        <%= image_tag @movie.image %>
        <h3 class="movie-title"><%= @movie.title %></h3>
        <p class="movie-release-year"><%= @movie.release_year %></p>
        <p class="movie-plot"><%= @movie.plot %></p>
      </div>
    </div>

    <h2>Cast</h2>
    <% @actors.each do |a| %>
    <div class="actor">
      <%= image_tag a.image %>
      <h3 class="actor-name"><%= a.first_name + ' ' + a.last_name %></h3>
      <p class="actor-bio"><%= a.bio %></p>
    </div>
    <% end %>
  </div>
</div>

Anyone know how to deal with this? I saw another topic for this, but it was closed and had no solution posted.


Movies II part 5/7 step 3
Associations II /Movies II 5/3
#2

Hi @bitace73400,

Could you please post a screenshot of the issue and a link to the exercise you're on?

Also, what's the content of your db/seeds.rb file? It may have an error in it.


#3

Here's a screenshot:

The console seems to have been cleared at some point (no idea how though), hence its blankness.

Here's a copy of my db/seeds file:

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)

a1 = Actor.create(first_name: "George", last_name: "Clooney", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/george-clooney.jpg", bio: "George Timothy Clooney is an American actor, writer, producer, director, and activist. He has received three Golden Globe Awards for his ...")
a2 = Actor.create(first_name: "Matt", last_name: "Damon", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/matt-damon.jpg", bio: "Matthew Paige \"Matt\" Damon is an American actor, voice actor, screenwriter, producer, and philanthropist.")
a3 = Actor.create(first_name: "Brad", last_name: "Pitt", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/brad-pitt.jpg", bio: "William Bradley \"Brad\" Pitt is an American actor and producer. He has received a Golden Globe Award, a Screen Actors Guild Award, and thr...")
a4 = Actor.create(first_name: "Elliot", last_name: "Gould", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/elliot-gould.jpg", bio: "Elliott Gould is an American actor. He began acting in Hollywood films during the 1960s, and has remained prolific ever since. ")
a5 = Actor.create(first_name: "Julia", last_name: "Roberts", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/julia-roberts.jpg", bio: "Julia Fiona Roberts is an American actress and producer. She became a Hollywood star after headlining the romantic comedy Pretty Woman, w...")
a6 = Actor.create(first_name: "Mark", last_name: "Wahlberg", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/mark-wahlberg.jpg", bio: "Mark Robert Michael Wahlberg is an American actor, producer, model, and former rapper. He was known as Marky Mark in his earlier years, b...")
a7 = Actor.create(first_name: "Marion", last_name: "Cotillard", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/marion-cotillard.jpg", bio: "Marion Cotillard is a French actress, singer, songwriter, environmentalist and spokesperson for Greenpeace.")
a8 = Actor.create(first_name: "Laurence", last_name: "Fishburne", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/laurence-fishburne.jpg", bio: "Laurence John Fishburne III is an American actor, playwright, director, and producer. He is best known for his roles as Morpheus in the M...")
a9 = Actor.create(first_name: "Jude", last_name: "Law", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/jude-law.jpg", bio: "David Jude Heyworth Law, known professionally as Jude Law, is an English actor, film producer and director. He began acting with the Nati...")
a10 = Actor.create(first_name: "Gwyneth", last_name: "Paltrow", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/gwyneth-paltrow.jpg", bio: "Gwyneth Kate Paltrow is an American actress, singer, and food writer. Paltrow gained early notice for her work in films such as the psych...")
a11 = Actor.create(first_name: "Kate", last_name: "Winslet", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/kate-winslet.jpg", bio: "Kate Elizabeth Winslet, CBE, is an English actress and singer. She is the recipient of an Academy Award, an Emmy Award, three Golden Glob...")
a12 = Actor.create(first_name: "Bryan", last_name: "Cranston", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/bryan-cranston.jpg", bio: "Bryan Lee Cranston is an American actor, voice actor, screenwriter, director and producer. Cranston is best known for portraying Walter W...")
a13 = Actor.create(first_name: "Leonardo", last_name: "DiCaprio", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/leonardo-dicaprio.jpg", bio: "Leonardo Wilhelm DiCaprio is an American actor and film producer. He has been nominated for ten Golden Globe Awards, winning two, and fo...")
a14 = Actor.create(first_name: "Jack", last_name: "Nicholson", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/jack-nicholson.jpg", bio: "John Joseph \"Jack\" Nicholson is an American actor, film director, producer, and writer. Throughout his career, Nicholson has portrayed un...")
a15 = Actor.create(first_name: "Joseph", last_name: "Gordon-Levitt", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/joseph-gordon-levitt.jpg", bio: "Joseph Leonard Gordon-Levitt is an American actor and filmmaker. As a child star, he appeared in the films A River Runs Through It, Angel...")
a16 = Actor.create(first_name: "Tom", last_name: "Hardy", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/tom-hardy.jpg", bio: "Edward Thomas \"Tom\" Hardy is an English actor. Hardy's notable film roles include the science fiction film Star Trek: Nemesis, the Guy Ri...")
a17 = Actor.create(first_name: "Cillian", last_name: "Murphy", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/cillian-murphy.jpg", bio: "Cillian Murphy is an Irish actor of stage and screen. Since making his debut in his home country in the late 1990s, Murphy has also becom...")
a18 = Actor.create(first_name: "Christian", last_name: "Bale", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/christian-bale.jpg", bio: "Christian Charles Philip Bale is an English actor. He has starred in both blockbuster films and smaller projects from independent produce...")
a19 = Actor.create(first_name: "Morgan", last_name: "Freeman", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/morgan-freeman.jpg", bio: "Morgan Freeman is an American actor, film director, and narrator. Freeman has received Academy Award nominations for his performances in ...")
a20 = Actor.create(first_name: "Robert", last_name: "Downey Jr.", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/rdj.jpg", bio: "Robert John Downey Jr. is an American actor, producer, and singer. Making his screen debut at the age of five, appearing in his father Ro...")
a21 = Actor.create(first_name: "Terrence", last_name: "Howard", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/terrence-howard.jpg", bio: "Terrence Dashon Howard is an American actor and singer. Having his first major role in the 1995 film Dead Presidents, and Mr. Holland's O...")
a22 = Actor.create(first_name: "Jeff", last_name: "Bridges", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/jeff-bridges.jpg", bio: "Jeffrey Leon \"Jeff\" Bridges is an American actor, country musician, and producer. He comes from a well-known acting family and began his ...")
a23 = Actor.create(first_name: "Rachel", last_name: "McAdams", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/rachel-mcadams.jpg", bio: "Rachel Anne McAdams is a Canadian actress. After graduating from a four-year theatre program at York University in 2001, she initially wo...")
a24 = Actor.create(first_name: "Mark", last_name: "Strong", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/mark-strong.jpg", bio: "Mark Strong is an English film and television actor. He is best known for his role in the television series Our Friends in the North and ...")
a25 = Actor.create(first_name: "Diane", last_name: "Lane", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/diane-lane.jpg", bio: "Diane Lane is an American actress. Born and raised in New York City, Lane made her screen debut in George Roy Hill's 1979 film A Little R...")
a26 = Actor.create(first_name: "Ellen", last_name: "Page", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/ellen-page.jpg", bio: "Ellen Philpotts-Page, known professionally as Ellen Page, is a Canadian actress. She started her career in Canada with roles in the telev...")
a27 = Actor.create(first_name: "Anne", last_name: "Hathaway", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/anne-hathaway.jpg", bio: "Anne Jacqueline Hathaway is an American actress, singer, and producer. After several stage roles, she appeared in the 1999 television ser...")
a28 = Actor.create(first_name: "Michael", last_name: "Caine", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/michael-caine.jpg", bio: "Sir Michael Caine, CBE is an English actor and author. Renowned for his distinctive Cockney accent, Caine has appeared in over 115 films ...")
a29 = Actor.create(first_name: "Natalie", last_name: "Portman", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/natalie-portman.png", bio: "Natalie Portman is an Israeli-born American actress, producer, and director. Her first role was in the 1994 action thriller Lon: The Pr...")
a30 = Actor.create(first_name: "Clive", last_name: "Owen", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/clive-owen.jpg", bio: "Clive Owen is an English actor who first gained recognition in the United Kingdom for playing the lead role in the ITV series Chancer fro...")
a31 = Actor.create(first_name: "Matthew", last_name: "McConaughey", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/matthew-mcconaughey.jpg", bio: "Matthew David McConaughey is an American actor and producer. He first gained notice for his breakout role in the coming-of-age comedy Daz...")

m1 = Movie.create(title: "Ocean's 11", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/oceans-11.jpg", release_year: "2001", plot: "Dapper Danny Ocean (George Clooney) is a man of action. Less than 24 hours into his parole from a New Jersey penitentiary, the wry, chari...")
m2 = Movie.create(title: "The Perfect Storm", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/the-perfect-storm.jpg", release_year: "2000", plot: "Based on a true story, the film tells of the courageous men and women who risk their lives every working day, pitting their fishing boats...")
m3 = Movie.create(title: "Contagion", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/contagion.jpg", release_year: "2011", plot: "When Beth Emhoff (Gwyneth Paltrow) returns to Minnesota from a Hong Kong business trip, she attributes the malaise she feels to jet lag ...")
m4 = Movie.create(title: "The Departed", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/the-departed.jpg", release_year: "2006", plot: "South Boston cop Billy Costigan (Leonardo DiCaprio) goes under cover to infiltrate the organization of gangland chief Frank Costello (Jac...")
m5 = Movie.create(title: "Inception", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/inception.jpg", release_year: "2010", plot: "Dom Cobb (Leonardo DiCaprio) is a thief with the rare ability to enter people's dreams and steal their secrets from their subconscious ...")
m6 = Movie.create(title: "The Dark Knight Rises", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/dark-knight-rises.jpg", release_year: "2012", plot: "It has been eight years since Batman (Christian Bale), in collusion with Commissioner Gordon (Gary Oldman), vanished into the night. Assu...")
m7 = Movie.create(title: "Iron Man", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/iron-man.jpg", release_year: "2008", plot: "A billionaire industrialist and genius inventor, Tony Stark (Robert Downey Jr.), is conducting weapons tests overseas, but terrorists kid...")
m8 = Movie.create(title: "Sherlock Holmes", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/sherlock-holmes.jpg", release_year: "2009", plot: "When a string of brutal murders terrorizes London, it doesn't take long for legendary detective Sherlock Holmes (Robert Downey Jr.) and ...")
m9 = Movie.create(title: "Closer", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/closer.jpg", release_year: "2004", plot: "Alice (Natalie Portman), who has moved to London, meets Dan (Jude Law) on the street. While looking at him, a taxi hits her. After taking ...")
m10 = Movie.create(title: "Interstellar", image: "http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/interstellar.jpg", release_year: "2014", plot: "In Earth's future, a global crop blight and second Dust Bowl are slowly rendering the planet uninhabitable. Professor Brand (Michael Cai...")

m1.actors << [a1, a2, a3, a4, a5]
m2.actors << [a1, a6, a25]
m3.actors << [a7, a8, a9, a10, a11, a12, a4, a2]
m4.actors << [a2, a13, a14, a6]
m5.actors << [a13, a26, a15, a16, a7, a17, a28]
m6.actors << [a18, a19, a28, a16, a7, a17, a15, a27]
m7.actors << [a20, a21, a22, a10]
m8.actors << [a20, a9, a23, a24]
m9.actors << [a5, a9, a29, a30]
m10.actors << [a31, a27, a28, a2]

Edit: Almost forgot to link to the exercise: https://www.codecademy.com/courses/learn-rails/lessons/many-to-many/exercises/many-to-many-movies-ii?action=lesson_resume&link_content_target=interstitial_lesson

(Please ignore my many, many tabs)


#4

@bitace73400 Your code looks fine, I'd suggest refreshing the page and/or changing line 18 to look like this instead:

<h3 class="actor-name"><%= actor.first_name %> <%= actor.last_name %></h3>

#5

I refreshed and made the change you suggested. I then hit "Run", and got the same error.

Is there anything else I can try?


#6

@bitace73400 Nothing else immediately comes to mind for me. Are there any files that contain [anything].name?


#7

I only found one such file, namely public/index.html.
It contains td.name.
Here's the file content:

<!DOCTYPE html>
<html>
  <head>
    <title>Ruby on Rails: Welcome aboard</title>
    <style type="text/css" media="screen">
      body {
        margin: 0;
        margin-bottom: 25px;
        padding: 0;
        background-color: #f0f0f0;
        font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
        font-size: 13px;
        color: #333;
      }

      h1 {
        font-size: 28px;
        color: #000;
      }

      a  {color: #03c}
      a:hover {
        background-color: #03c;
        color: white;
        text-decoration: none;
      }


      #page {
        background-color: #f0f0f0;
        width: 750px;
        margin: 0;
        margin-left: auto;
        margin-right: auto;
      }

      #content {
        float: left;
        background-color: white;
        border: 3px solid #aaa;
        border-top: none;
        padding: 25px;
        width: 500px;
      }

      #sidebar {
        float: right;
        width: 175px;
      }

      #footer {
        clear: both;
      }

      #header, #about, #getting-started {
        padding-left: 75px;
        padding-right: 30px;
      }


      #header {
        background-image: url("assets/rails.png");
        background-repeat: no-repeat;
        background-position: top left;
        height: 64px;
      }
      #header h1, #header h2 {margin: 0}
      #header h2 {
        color: #888;
        font-weight: normal;
        font-size: 16px;
      }


      #about h3 {
        margin: 0;
        margin-bottom: 10px;
        font-size: 14px;
      }

      #about-content {
        background-color: #ffd;
        border: 1px solid #fc0;
        margin-left: -55px;
        margin-right: -10px;
      }
      #about-content table {
        margin-top: 10px;
        margin-bottom: 10px;
        font-size: 11px;
        border-collapse: collapse;
      }
      #about-content td {
        padding: 10px;
        padding-top: 3px;
        padding-bottom: 3px;
      }
      #about-content td.name  {color: #555}
      #about-content td.value {color: #000}

      #about-content ul {
        padding: 0;
        list-style-type: none;
      }

      #about-content.failure {
        background-color: #fcc;
        border: 1px solid #f00;
      }
      #about-content.failure p {
        margin: 0;
        padding: 10px;
      }


      #getting-started {
        border-top: 1px solid #ccc;
        margin-top: 25px;
        padding-top: 15px;
      }
      #getting-started h1 {
        margin: 0;
        font-size: 20px;
      }
      #getting-started h2 {
        margin: 0;
        font-size: 14px;
        font-weight: normal;
        color: #333;
        margin-bottom: 25px;
      }
      #getting-started ol {
        margin-left: 0;
        padding-left: 0;
      }
      #getting-started li {
        font-size: 18px;
        color: #888;
        margin-bottom: 25px;
      }
      #getting-started li h2 {
        margin: 0;
        font-weight: normal;
        font-size: 18px;
        color: #333;
      }
      #getting-started li p {
        color: #555;
        font-size: 13px;
      }


      #sidebar ul {
        margin-left: 0;
        padding-left: 0;
      }
      #sidebar ul h3 {
        margin-top: 25px;
        font-size: 16px;
        padding-bottom: 10px;
        border-bottom: 1px solid #ccc;
      }
      #sidebar li {
        list-style-type: none;
      }
      #sidebar ul.links li {
        margin-bottom: 5px;
      }

      .filename {
        font-style: italic;
      }
    </style>
    <script type="text/javascript">
      function about() {
        info = document.getElementById('about-content');
        if (window.XMLHttpRequest)
          { xhr = new XMLHttpRequest(); }
        else
          { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
        xhr.open("GET","rails/info/properties",false);
        xhr.send("");
        info.innerHTML = xhr.responseText;
        info.style.display = 'block'
      }
    </script>
  </head>
  <body>
    <div id="page">
      <div id="sidebar">
        <ul id="sidebar-items">
          <li>
            <h3>Browse the documentation</h3>
            <ul class="links">
              <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
              <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
              <li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
              <li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
            </ul>
          </li>
        </ul>
      </div>

      <div id="content">
        <div id="header">
          <h1>Welcome aboard</h1>
          <h2>You're riding Ruby on Rails!</h2>
        </div>

        <div id="about">
          <h3><a href="rails/info/properties" onclick="about(); return false">About your application's environment</a></h3>
          <div id="about-content" style="display: none"></div>
        </div>

        <div id="getting-started">
          <h1>Getting started</h1>
          <h2>Here's how to get rolling:</h2>

          <ol>
            <li>
              <h2>Use <code>rails generate</code> to create your models and controllers</h2>
              <p>To see all available options, run it without parameters.</p>
            </li>

            <li>
              <h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
              <p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
            </li>

            <li>
              <h2>Create your database</h2>
              <p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
            </li>
          </ol>
        </div>
      </div>

      <div id="footer">&nbsp;</div>
    </div>
  </body>
</html>

I also found one file containing name:, and three that contain name= within an html tag, but I suspect that (in both cases) it's a preexisting keyword.


#8

@bitace73400 That's weird, since the error message is indicating you're trying to access the name property of a nil variable. I'm rapidly running out of ideas, perhaps you could try switching browsers?

Sorry I can't be more helpful :sweat_smile:


#9

Thanks for trying, though.

Anyway, I'll try Firefox instead of Chrome, and let you know if anything changes.

What's annoying is that ran into a similar issue earlier in the course. My code ended up looking exactly like that provided by the "Get code" button, just indented a bit more. I got pretty much this exact error, if I'm remembering right, and I got around it by changing the indentation. ¯\_(ツ)_/¯
And before that, rake wasn't working properly on either db:migrate or db:seed, which is why I now use bundle exec rake instead.

(I find it hilarious that there exists a middle finger emoji, but no shrug)


#10

@bitace73400 Yeah, there've been a few issues with different versions of Rails and Gems as the course ages, causing you to have to prepend bundle exec like that :confused:

(I find it hilarious that there exists a middle finger emoji, but no shrug)

I think I remember something about one coming out soon...

Yeah, here it is:

🤷

Looks like our version of Emoji One doesn't provide it by default yet, though.


#11

Can we see your migration files?


#12

Sure.
Here's the one for Movies:

Here's the one for Actors:

And here's the one for Parts:


#13

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.