After installing devise with devise_install successfully, when restarting the server, I am getting the following error. Please help me. I have gone through number of questions and I am not getting correct response .
Error :
bfmt048#bfmt048-System-Product-Name:~/demo$ rails s
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on zero.zero.zero.zero:threethousand
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:46:in `check_options_validity': The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option? (ArgumentError)
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:20:in `check_validity!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validator.rb:143:in `initialize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:87:in `new'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:87:in `block in validates_with'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:86:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:86:in `validates_with'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:111:in `validates_format_of'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models/validatable.rb:20:in `block in included'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models/validatable.rb:17:in `class_eval'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models/validatable.rb:17:in `included'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `include'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `block (2 levels) in devise'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `block in devise'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:77:in `devise_modules_hook!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:62:in `devise'
from /home/bfmt048/demo/app/models/user.rb:4:in `<class:User>'
from /home/bfmt048/demo/app/models/user.rb:1:in `<top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `block in load_file'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:422:in `load_file'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:323:in `require_or_load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:462:in `load_missing_constant'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:183:in `const_missing'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `const_get'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `inject'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `constantize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/mapping.rb:75:in `to'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/mapping.rb:68:in `modules'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/mapping.rb:81:in `strategies'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise.rb:166:in `register'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/rails/routes.rb:93:in `block in devise_for'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/rails/routes.rb:92:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/rails/routes.rb:92:in `devise_for'
from /home/bfmt048/demo/config/routes.rb:3:in `block in <top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `instance_exec'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `eval_block'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:294:in `draw'
from /home/bfmt048/demo/config/routes.rb:1:in `<top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `call'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/bfmt048/demo/config/environment.rb:5:in `<top (required)>'
from /home/bfmt048/demo/config.ru:3:in `require'
from /home/bfmt048/demo/config.ru:3:in `block in <main>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/bfmt048/demo/config.ru:in `new'
from /home/bfmt048/demo/config.ru:in `<main>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
ArgumentError: The provided regular expression is using multiline anchors (^ or $),
which may present a security risk. Did you mean to use \A and \z,
or forgot to add the :multiline => true option?
This error occurs when trying to upgrade from previous version of rails to rails 4.0.0.
Regexp validation for validates_format_of.
If you don’t expect multiline incoming data, you need to replace all the “^” with “\A” and all the “$” with “\z”. If you expect multiline strings, just specify the multiline: true option.
Source: http://dev.mensfeld.pl/2013/07/upgrading-to-rails-4-0-from-rails-3-2-test-case-part-ii-assets-models/
Not sure of the specific reason for your error, but I would try updating devise to latest version which supports rails 4.0.0.
this is a new check in rails 4. why are you using such an old devise version (and why an rc?). just use the most recent release by putting
gem "devise", "~> 3.0.3"
in your Gemfile
It's not safe to use ^ and $ since $ matches \n (new-line characted) which has the possibility to enter an email like "test123#example.com\n< script>/* ... */< /script >"
http://edgeguides.rubyonrails.org/active_record_validations.html#format
So if we use ^ and $ to match the end or beginning of an expression then the above is likely to pass the filter and any malicious code can be passed in with the email entered.
We can either use the /A, /Z option to specfy the beginning and end of a line, instead of ^ and $, or else we can set the :multiline option to true
eg: validates :content, format: { with: /^Meanwhile$/, multiline: true }
http://edgeguides.rubyonrails.org/security.html#regular-expressions
Related
Over the weekend I shut my localhost server down because I wasn't doing anything with it. However this week I have had a host of issues with booting it back up. My first problem with something with rmagick, I had to either install(?) or update command line tools, reinstall rmagick and nokogiri.
Now that problem seems to be behind me but every time I run rails s
It cashes after boot and I get this error:
=> Booting WEBrick
=> Rails 4.2.5.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/tfantina/Documents/Code and Websites/Ruby & Rails Stuff/professor/config/initializers/recaptcha.rb:11:in `block in <top (required)>': undefined method `public_key=' for #<Recaptcha::Configuration:0x007fbaa89d09d0> (NoMethodError)
Did you mean? public_send
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/recaptcha-4.0.0/lib/recaptcha.rb:30:in `configure'
from /Users/tfantina/Documents/Code and Websites/Ruby & Rails Stuff/professor/config/initializers/recaptcha.rb:10:in `<top (required)>'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:166:in `instrument'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/engine.rb:651:in `load_config_initializer'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `each'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `each'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /Users/tfantina/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
from /Users/tfantina/Documents/Code and Websites/Ruby & Rails Stuff/professor/config/environment.rb:5:in `<top (required)>'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
from /Users/tfantina/Documents/Code and Websites/Ruby & Rails Stuff/professor/config.ru:3:in `block in <main>'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/builder.rb:55:in `instance_eval'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/builder.rb:55:in `initialize'
from /Users/tfantina/Documents/Code and Websites/Ruby & Rails Stuff/professor/config.ru:in `new'
from /Users/tfantina/Documents/Code and Websites/Ruby & Rails Stuff/professor/config.ru:in `<main>'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/builder.rb:49:in `eval'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/builder.rb:49:in `new_from_string'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/server.rb:208:in `app'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands/server.rb:61:in `app'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/rack-1.6.5/lib/rack/server.rb:336:in `wrapped_app'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands/server.rb:78:in `start'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/tfantina/.rvm/gems/ruby-2.3.1/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I haven't touched that initializer in weeks, I even checked my git status to be sure and nothing has changed. Any ideas on why this keeps crashing?
Recaptcha has been updated.
https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md
public_key to site_key
private_key to secret_key
Change your config/initializers/recaptcha.rb
Recaptcha.configure do |config|
config.site_key = 'public key'
config.secret_key = 'private key'
My rails server doesn't work for one project, but DOES work for another project.
For the project that does not work, when I run rails s in my terminal I get the the following output:
=> Booting Thin
=> Rails 4.1.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/christinating/.rvm/gems/ruby-2.1.3/bundler/gems/active_admin-48a8674a4566/lib/active_admin/application.rb:116:in `allow_comments=': `config.allow_comments` is no longer provided in ActiveAdmin 1.x. Use `config.comments` instead. (RuntimeError)
from /Users/christinating/scholarhood/config/initializers/active_admin.rb:104:in `block in <top (required)>'
from /Users/christinating/.rvm/gems/ruby-2.1.3/bundler/gems/active_admin-48a8674a4566/lib/active_admin.rb:71:in `setup'
from /Users/christinating/scholarhood/config/initializers/active_admin.rb:1:in `<top (required)>'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/zeus-0.15.4/lib/zeus/load_tracking.rb:50:in `load'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/zeus-0.15.4/lib/zeus/load_tracking.rb:50:in `load'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/zeus-0.15.4/lib/zeus/load_tracking.rb:43:in `load'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/engine.rb:648:in `block in load_config_initializer'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/notifications.rb:161:in `instrument'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/engine.rb:647:in `load_config_initializer'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/engine.rb:611:in `each'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/engine.rb:611:in `block in <class:Engine>'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/initializable.rb:44:in `each'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/christinating/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/railtie.rb:194:in `public_send'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/railtie.rb:194:in `method_missing'
from /Users/christinating/scholarhood/config/environment.rb:5:in `<top (required)>'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
from /Users/christinating/scholarhood/config.ru:11:in `block in <main>'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/christinating/scholarhood/config.ru:in `new'
from /Users/christinating/scholarhood/config.ru:in `<main>'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands/server.rb:50:in `app'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands/server.rb:67:in `start'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/christinating/.rvm/gems/ruby-2.1.3/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
This project requires version ruby 2.1.3 to work though.
Can anyone please help me?
According to the error message:
config.allow_comments is no longer provided in ActiveAdmin 1.x. Use config.comments instead.
So, you need to edit config/initializers/active_admin.rb and change:
config.allow_comments
to:
config.comments
The following message pops up when I enter $ rails server in the Terminal (Mac, running latest version of Yosemite). I'm pretty lost, other topics have recommended altering the text in the config folder of my project, but what I've tried hasn't worked and I'm guessing because those are slightly dated topics.
I'm learning from the Learn Ruby on Rails book trying to get this MailChimp application working, completed up to the 13th chapter without any big issues. Any help is appreciated.
=> Booting WEBrick
=> Rails 4.1.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (-- binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:370:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 14 column 1 (Psych::SyntaxError)
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:370:in `parse_stream'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:318:in `parse'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:245:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:313:in `secrets'
from /Users/dengel29/workspace/learn-rails/config/environments/development.rb:32:in `block in <top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in `instance_eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in `configure'
from /Users/dengel29/workspace/learn-rails/config/environments/development.rb:1:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:594:in `block (2 levels) in <class:Engine>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in `each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in `block in <class:Engine>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
from /Users/dengel29/workspace/learn-rails/config/environment.rb:5:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/workspace/learn-rails/config.ru:3:in `block in <main>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/dengel29/workspace/learn-rails/config.ru:in `new'
from /Users/dengel29/workspace/learn-rails/config.ru:in `<main>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:50:in `app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:67:in `start'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/dengel29/workspace/learn-rails/bin/rails:8:in `require'
from /Users/dengel29/workspace/learn-rails/bin/rails:8:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/dengel29/workspace/learn-rails/bin/spring:16:in `require'
from /Users/dengel29/workspace/learn-rails/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Perhaps your ENV variables are not set up correctly, or you have an unusual character in one of the variables. Be careful there are not tab characters or any unusual characters in the config/secrets.yml file.
I suggest you replace all ENV values in the config/secrets.yml with hardcoded strings. Don't check the file into git with your private credentials in the file. Just test it to see if you can isolate the problem.
I've recently upgraded my rails 3.2 project to 4.0. I've been successful in upgrading my app for the most part by following the guides. I have a few issues that I'm not sure what direction I should go and I'm looking for some help.
I was using quite a few attr_accessible on my models that I've now removed based in the advice in the guides. The guides say :
Rails 4.0 has removed attr_accessible and attr_protected feature in
favor of Strong Parameters. You can use the Protected Attributes gem
for a smooth upgrade path.
This gem got my application running but anytime I try to create a new object such as a user, message, etc. I get an error. From some research this seems common when using the new gem. It was suggested to remove the gem which would solve the new object issues. I did that but now I'm getting multiple errors from some of the other gems in my applications (And yes I've upgraded all gems to the most recent versions). Here is the error I'm getting:
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activemodel-4.0.0/lib/active_model/deprecated_mass_assignment_security.rb:14:in `attr_accessible': `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. (RuntimeError)
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/acts-as-messageable-0.4.8/lib/acts-as-messageable/message.rb:8:in `<class:Message>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/acts-as-messageable-0.4.8/lib/acts-as-messageable/message.rb:4:in `<module:ActsAsMessageable>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/acts-as-messageable-0.4.8/lib/acts-as-messageable/message.rb:3:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:228:in `const_get'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:228:in `block in constantize'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `inject'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `constantize'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/acts-as-messageable-0.4.8/lib/acts-as-messageable/model.rb:34:in `acts_as_messageable'
from /Users/dave/rails_projects/EquiptMe/app/models/user.rb:14:in `<class:User>'
from /Users/dave/rails_projects/EquiptMe/app/models/user.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `block in load_file'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:422:in `load_file'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:323:in `require_or_load'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:462:in `load_missing_constant'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:183:in `const_missing'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `const_get'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `inject'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `constantize'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:534:in `get'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:565:in `constantize'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise.rb:278:in `get'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/mapping.rb:77:in `to'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/mapping.rb:72:in `modules'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/mapping.rb:89:in `routes'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/mapping.rb:156:in `default_used_route'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/mapping.rb:66:in `initialize'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise.rb:312:in `new'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise.rb:312:in `add_mapping'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/rails/routes.rb:208:in `block in devise_for'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/rails/routes.rb:207:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/devise-3.0.1/lib/devise/rails/routes.rb:207:in `devise_for'
from /Users/dave/rails_projects/EquiptMe/config/routes.rb:7:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `instance_exec'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `eval_block'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:294:in `draw'
from /Users/dave/rails_projects/EquiptMe/config/routes.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `call'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `execute'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/dave/rails_projects/EquiptMe/config/environment.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /Users/dave/rails_projects/EquiptMe/config.ru:3:in `block in <main>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/dave/rails_projects/EquiptMe/config.ru:in `new'
from /Users/dave/rails_projects/EquiptMe/config.ru:in `<main>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Could someone point me in the right direction?
Thanks
I would try using the master branch of the "acts-as-messageable" gem in your Gemfile. It looks like there have been some updates related to Rails 4 since it was last released. If that fixes it, I'd ping the author to see if they'd release a new version.
There is a new gem created recently to help with upgrading from Rails 3 to Rails 4. I've used it recently and it made the upgrading process so much easier.
The gem is called wize_upgrader.
One thing that this gem does with attr_accessible in rails 3 models is that is converts it into strong params for you in your controller.
i.e: (in posts_controller)
def post_params
params.require(:post).permit(:title, :content, :tag)
end
I ran a bundle install and since have not been able to run rails s successfully within terminal. I am new to rails and have tried to find help on this but nobody can explain it to me in the 101 way. What is going wrong - it looks like this is a NameError?
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Use (NameError)
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise.rb:267:in `get'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/mapping.rb:77:in `to'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/mapping.rb:72:in `modules'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/mapping.rb:89:in `routes'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/mapping.rb:156:in `default_used_route'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/mapping.rb:66:in `initialize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise.rb:301:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise.rb:301:in `add_mapping'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/rails/routes.rb:208:in `block in devise_for'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/rails/routes.rb:207:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.3/lib/devise/rails/routes.rb:207:in `devise_for'
from /Users/cfictum/Documents/rails_projects/omrails/config/routes.rb:3:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:260:in `draw'
from /Users/cfictum/Documents/rails_projects/omrails/config/routes.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `call'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `execute'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:27:in `updater'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/cfictum/Documents/rails_projects/omrails/config/environment.rb:5:in `<top (required)>'
from /Users/cfictum/Documents/rails_projects/omrails/config.ru:4:in `block in <main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /Users/cfictum/Documents/rails_projects/omrails/config.ru:1:in `new'
from /Users/cfictum/Documents/rails_projects/omrails/config.ru:1:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/server.rb:46:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/server.rb:70:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:55:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I think that you have typed Use instead of use, perhaps in config/routes.rb
Case is important, if it starts with a capital letter then it is a constant, rather than a function.