28 Jan 2013, 13:50
Generic-user-small

Jooin Kim (15 posts)

I downloaded the code for RailsView. As I followed the readme, it gave full of craps when I type the command “rake setup”. I put the error below.


undefined method client_id' for nil:NilClass /Users/nainirajk/rails_projects/RailsView/layout/app/models/creation.rb:55:in copy_client_id’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:407:in _run__2299637010585796928__validation__217351591600834783__callbacks' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in __run_callback’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in _run_validation_callbacks' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in run_callbacks’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activemodel-3.2.11/lib/active_model/validations/callbacks.rb:53:in run_validations!' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activemodel-3.2.11/lib/active_model/validations.rb:195:in valid?’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/validations.rb:69:in valid?' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/paperclip-3.4.0/lib/paperclip/attachment.rb:373:in valid_assignment?’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/paperclip-3.4.0/lib/paperclip/attachment.rb:108:in assign' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/paperclip-3.4.0/lib/paperclip.rb:199:in block in has_attached_file’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/attribute_assignment.rb:85:in block in assign_attributes' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/attribute_assignment.rb:78:in each’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/attribute_assignment.rb:78:in assign_attributes' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/base.rb:497:in initialize’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/reflection.rb:183:in new' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/reflection.rb:183:in build_association’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/associations/association.rb:233:in build_record' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/associations/collection_association.rb:434:in block in create_record’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/associations/collection_association.rb:149:in block in transaction' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in transaction’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/transactions.rb:208:in transaction' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/associations/collection_association.rb:148:in transaction’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/associations/collection_association.rb:433:in create_record' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/associations/collection_association.rb:123:in create!’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/associations/collection_proxy.rb:46:in create!' /Users/nainirajk/rails_projects/RailsView/layout/lib/project_seeder.rb:28:in block in run’ /Users/nainirajk/rails_projects/RailsView/layout/lib/project_seeder.rb:23:in each' /Users/nainirajk/rails_projects/RailsView/layout/lib/project_seeder.rb:23:in run’ /Users/nainirajk/rails_projects/RailsView/layout/lib/project_seeder.rb:12:in run' /Users/nainirajk/rails_projects/RailsView/layout/db/seeds.rb:35:in <top (required)>’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in load' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in block in load’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in load_dependency' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in load’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/railties-3.2.11/lib/rails/engine.rb:520:in load_seed' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/gems/activerecord-3.2.11/lib/active_record/railties/databases.rake:333:in block (2 levels) in <top (required)>’ /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/bin/ruby_noexec_wrapper:14:in eval' /Users/nainirajk/.rvm/gems/ruby-1.9.3-p327@therailsview/bin/ruby_noexec_wrapper:14:in ' Tasks: TOP => setup => db:setup => db:seed

28 Jan 2013, 14:05
Generic-user-small

Jooin Kim (15 posts)

anyone gets these error messages?

31 Jan 2013, 15:57
_mg_2366_pragsmall

John M Athayde (39 posts)

Jooin -

nil method means that the parent class doesn’t have a relationship to client in this case. I’m taking a look at it with a fresh code download to see if I can replicate.

31 Jan 2013, 16:21
_mg_2366_pragsmall

John M Athayde (39 posts)

I can replicate in the Layout chapter. Working on a fix for you.

The issue is with the

@ProjectSeeder.run(shirt, ‘rubyconf2011-shirt’, spade)@

line, or the ProjectSeeder method entire perhaps.

31 Jan 2013, 16:32
_mg_2366_pragsmall

John M Athayde (39 posts)

Try changing this line in Gemfile:

@gem “paperclip”@

to

@gem “paperclip”, “~> 2.7”@

and let me know if it works for you. Be sure to run rake db:drop first.

24 Mar 2013, 20:45
172848_pragsmall

Craig Riecke (19 posts)

I was having the same problem. Changed the line in the Gemfile as above, then Paperclip complained about not having ImageMagick. I installed it on Ubuntu with:

sudo apt-get install imagemagick

Apparently the equivalent on MacOS is:

brew install imagemagick

But that made everything work fine!

  You must be logged in to comment