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 trialMathew Turner
325 PointsI'm not getting an error that the lesson says I should get.
I'm working on the Creating Relationships video and I'm not getting the error: ActiveModel::MassAssignmentSecurity::Error in StatusesController#Update. I've never gotten this error even when they said I should. When I go and make the changes the lesson says to make to fix this error I get this error:
"attr_accessible
is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add protected_attributes
to your Gemfile to use old one."
Also, the Coffee script that we did in the earlier lessons for Ruby only work if I hit refresh after the page loads.
I'm using the newest version of Ruby on Rails and running the latest version of FireFox on Win7 32bit.
3 Answers
Richard Crawford-Wilson
6,094 PointsYour using Rails 4.0, you need to use Ruby on Rails 3.2.14
Richard Crawford-Wilson
6,094 PointsCopy and paste this Gemfile over yours:
https://github.com/Senjai/Treehouse/blob/master/treebook/Gemfile
Delete gemfile.lock
then try bundle install again.
Mathew Turner
325 PointsIt says the version is there but does this mean that I need to reinstall Devise and all that stuff?
Richard Crawford-Wilson
6,094 Pointsdevise is included in the gemfile i just linked to you. If you just replace your gemfile with the one i linked, delete Gemfile.lock and do bundle install, everything will be appropriate.
It comes with gems that will be used for the rest of the series too.
Mathew Turner
325 Pointsok thanks, but now it won't let me start the Rails server. Any idea what went wrong?
Nima Shariatian
1,760 PointsI have also been in the same boat but i suggest that you don't downgrade your version of ruby on rails or ruby, instead work around it. In rails 4 the protected attributes have been changed to strong parameters. have a look at this link for more information:
http://blog.remarkablelabs.com/2012/12/strong-parameters-rails-4-countdown-to-2013
Mathew Turner
325 PointsMathew Turner
325 PointsThe lesson said that I should get the most recent version of Ruby. How would I get Ruby on Rails 3.2.14 and how do I install it instead of Rails 4.0?
Richard Crawford-Wilson
6,094 PointsRichard Crawford-Wilson
6,094 PointsThe most recent version of ruby isnt the most recent version of rails. Rails 4.0 is very different from 3.2.
For a quick fix do the following in your Gemfile:
Change:
gem 'rails', '4.0.0' # or whatever it is to gem 'rails', '3.2.14'
Then delete the Gemfile.lock file in your applications root directory.
Then run bundle install again.
When you type rails -v it should say version 3.2.14
For a proper fix you might want to uninstall rails, and reinstall version 3.2.14 globally.
Mathew Turner
325 PointsMathew Turner
325 PointsHow do uninstall rails and reinstall version 3.2.14 because I did what you said and now I keep getting this error: ?[31mBundler could not find compatible versions for gem "activesupport": In Gemfile: rails (= 3.2.14) x86-mingw32 depends on activesupport (= 3.2.14) x86-mingw32
?[0m