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

Ruby

Have tried everything i contiune to have EXTREME issues with rails 4 and devise

This will probably be my fourth attempt at posting a discussion on devise and rails 4 and there issues. I always have issues installing devise with rails and even end up having to recreate my entire application after attempting to install it. I have bought a book , asked for help and gone through you guys videos. I cant seem to finish this http://teamtreehouse.com/library/build-a-simple-ruby-on-rails-application

Im really starting to feel that im not cut out for web development, i feel like im getting an understanding of something then it upgrades, then I am completely lost. i tried to uninstall devise and start over i got this error

rashadmad@ubuntu:~/webApps/BIB$ rails s => Booting WEBrick => Rails 4.0.0 application starting in development on http://0.0.0.0:3000 => Run rails server -h for more startup options => Ctrl-C to shutdown server Exiting /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in method_missing': undefined methodresources' for #<BIB::Application:0x00000003869770> (NoMethodError) from /home/rashadmad/webApps/BIB/config/environments/development.rb:2:in block in <top (required)>' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:inclass_eval' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:in configure' from /home/rashadmad/webApps/BIB/config/environments/development.rb:1:in<top (required)>' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in require' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:inblock in require' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in load_dependency' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:inrequire' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/engine.rb:591:in block (2 levels) in <class:Engine>' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/engine.rb:590:ineach' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/engine.rb:590:in block in <class:Engine>' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/initializable.rb:30:ininstance_exec' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/initializable.rb:30:in run' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/initializable.rb:55:inblock in run_initializers' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in block in tsort_each' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:inblock (2 levels) in each_strongly_connected_component' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:210:in block (2 levels) in each_strongly_connected_component_from' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:ineach_strongly_connected_component_from' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:209:in block in each_strongly_connected_component_from' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/initializable.rb:44:ineach' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/initializable.rb:44:in tsort_each_child' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:203:ineach_strongly_connected_component_from' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in block in each_strongly_connected_component' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:ineach' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in each_strongly_connected_component' from /home/rashadmad/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:intsort_each' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/initializable.rb:54:in run_initializers' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/application.rb:215:ininitialize!' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in method_missing' from /home/rashadmad/webApps/BIB/config/environment.rb:5:in<top (required)>' from /home/rashadmad/webApps/BIB/config.ru:3:in require' from /home/rashadmad/webApps/BIB/config.ru:3:inblock in <main>' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/builder.rb:55:in instance_eval' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/builder.rb:55:ininitialize' from /home/rashadmad/webApps/BIB/config.ru:in new' from /home/rashadmad/webApps/BIB/config.ru:in<main>' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/builder.rb:49:in eval' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/builder.rb:49:innew_from_string' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/builder.rb:40:in parse_file' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/server.rb:277:inbuild_app_and_options_from_config' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/server.rb:199:in app' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/commands/server.rb:48:inapp' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/rack-1.5.2/lib/rack/server.rb:314:in wrapped_app' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/commands/server.rb:75:instart' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/commands.rb:78:in block in <top (required)>' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/commands.rb:73:intap' from /home/rashadmad/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/commands.rb:73:in <top (required)>' from bin/rails:4:inrequire' from bin/rails:4:in `<main>'

5 Answers

For Rails 4 and Devise:

It's tricky for me as I'm a noob. It's a two part solution for the controller page: Works for me, FYI, I use a :profile_name here and you may not

class ApplicationController < ActionController::Base
    # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  before_filter :configure_permitted_parameters, if: :devise_controller?


protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) { |u| u.permit( :first_name, :last_name, :profile_name, :password_confirmation, :password, :email ) }
    devise_parameter_sanitizer.for(:sign_in) { |u| u.permit( :profile_name, :password, :email ) }
  end

end
Charles Massry
Charles Massry
12,253 Points

I had a similar issue with devise not working so i went back and restarted it with rails version 3.2.6 and it works

Brandon Barrette
Brandon Barrette
20,485 Points

Devise works with Rails 3.2.12, the version the videos were made with.

This is a common problem when a new version comes out. Gems that worked with older versions may not work under the new rails until they are updated.

Rails 3.2.12 is still common and used and I recommend learning under that first. Then when you are comfortable, update to rails 4.

It's like when Windows and Apple come out with a new OS, not all programs or apps will work on day 1. They have to be updated first. This is the same case with Rails.

I have had allot of issues downgradeing