Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

generating first status on ruby on rails

have an error when i generate my first status, i dont know why, when i do 127.0.0.1:3000/statuses, it give me this error

RuntimeError in StatusesController#index 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.

13 Answers

Andre' Jones
Andre' Jones
26,671 Points

your using rails 4. for that project I'd use Rails 3.2.xx. remember the attr_accessible list u made in your model? Thats the problem you can either add a gem (it may be specified in the error message which gem to add) I forget the name of it but google strong parameters and you will see tons of people with the same problem which solved it.

when generating my first status , that is when i do http://127.0.0.1:3000/statuses i have the following error. PLSSS HELP

ExecJS::RuntimeError in Statuses#index

Showing C:/Users/NEBELYN/ruby1/gopbook/app/views/layouts/application.html.erb where line #6 raised:

(in C:/Users/NEBELYN/ruby1/gopbook/app/assets/javascripts/statuses.js.coffee) Extracted source (around line #6):

3: 4: Gopbook 5: <%= stylesheet_link_tag "application", :media => "all" %> 6: <%= javascript_include_tag "application" %> 7: <%= csrf_meta_tags %> 8: 9: Rails.root: C:/Users/NEBELYN/ruby1/gopbook

Andre' Jones
Andre' Jones
26,671 Points

u can either delete the coffee script file, change its extension to js or a third option which i think is downloading and installing node.js but i havent tried this yet

when i download and install node, how do i integrate it into rails

Andre' Jones
Andre' Jones
26,671 Points

node was the only thing i hadnt tried yet. go to stackexchange and search this question if no one else here knows. i dont think u have to try and integrate it into rails though. There is something that comes along with the node.js install that solves your problem but again u dont have to mesh it with rails.

http://stackoverflow.com/questions/9202324/execjs-could-not-find-a-javascript-runtime-but-execjs-and-therubyracer-are-in I think this guy had the same problem scroll through and read the solutions

i am following the todo list application on rails 4 here on treehouse, they use bin/rails server to generate the server , but that command doesnt work on min, rather rails server works, but then the server shuts down on its own after 10s, i dont know my pc must run bin/rails server or its ok to run rails server.thanks

when i do rails/server i have the following, is there something am doing wrong

rails server => Booting WEBrick => Rails 4.0.2 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2013-12-26 23:29:07] INFO WEBrick 1.3.1 [2013-12-26 23:29:07] INFO ruby 2.0.0 (2013-11-22) [i386-mingw32] [2013-12-26 23:29:07] WARN TCPServer Error: Only one usage of each socket address (protocol/network address/po rt) is normally permitted. - bind(2) Exiting C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:85:in `initialize': Only one usage of each socket address (protocol/ network address/port) is normally permitted. - bind(2) (Errno::EADDRINUSE) from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:85:in `new' from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:85:in `block in create_listeners' from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:82:in `each' from C:/Ruby200/lib/ruby/2.0.0/webrick/utils.rb:82:in `create_listeners' from C:/Ruby200/lib/ruby/2.0.0/webrick/server.rb:132:in `listen' from C:/Ruby200/lib/ruby/2.0.0/webrick/server.rb:113:in `initialize' from C:/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:45:in `initialize' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in `new' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in `run' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in `start' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (req uired)>' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>'

Andre' Jones
Andre' Jones
26,671 Points

do u have a windows or mac computer

Andre' Jones
Andre' Jones
26,671 Points

WARN TCPServer Error: Only one usage of each socket address (protocol/network address/po rt) is normally permitted. U may have started the server in another project and didnt close it correctly. Go to you each of your projects go to tmp>pids> and if there is a file in that pids folder delete it

windows

i restarted my computer and i have the same error, i dont know whats going on

Andre' Jones
Andre' Jones
26,671 Points

did u check tmp>pids> make sure that folder is empty before u start rails s.

yes i did, they were empty