Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Henri Viiralt
9,092 PointsCode challenge: validations
Isn't passing, I've tried pasting directly from my user_test.rb to no avail.
validates :first_name, presence: true
validates :last_name, presence: true
validates :profile_name, presence: true
end
end
2 Answers
Steve Monsen
5,207 PointsThere should only be one "end" keyword at the bottom because the code block for
class User < ActiveRecord::Base
is the only thing in the test challenge code that needs to be terminated with an end keyword.
Tim Urista
Courses Plus Student 13,462 PointsMy code is also not working
class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
attr_accessible :email, :password, :password_confirmation, :remember_me, :first_name, :last_name, :profile_name validates :first_name, presence: true validates :last_name, presence: true validates :profile_name, presence: true end
I just get the following error
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/definition.rb:15:in build': /apps/treehouse_code_challenges/Gemfile not found (Bundler::GemfileNotFound)
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:135:indefinition'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:123:in load'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:107:insetup'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/setup.rb:17:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
Henri Viiralt
9,092 PointsHenri Viiralt
9,092 Pointsaah, that did the trick, thank you, kind sir!