devise - Rails NoMethodError: undefined method `[]=' for nil:NilClass in production environment -


i stuck on weird issue. have developed , tested rails application in development environment, in proccess of site , running on production environment needed run rake secret command. unfortunately, faced following error message:

rake aborted! nomethoderror: undefined method `[]=' nil:nilclass /var/www/html/comigo/comigo/config/application.rb:31:in `<class:application>' /var/www/html/comigo/comigo/config/application.rb:19:in `<module:comigo>' /var/www/html/comigo/comigo/config/application.rb:18:in `<top (required)>' /var/www/html/comigo/comigo/rakefile:4:in `require' /var/www/html/comigo/comigo/rakefile:4:in `<top (required)>' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/rake_module.rb:28:in `load' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/rake_module.rb:28:in `load_rakefile' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:686:in `raw_load_rakefile' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:96:in `block in load_rakefile' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:95:in `load_rakefile' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:79:in `block in run' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/lib/rake/application.rb:77:in `run' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in `<top (required)>' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/bin/rake:22:in `load' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/bin/rake:22:in `<main>' /home/deplguerrabr/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval' 

searching on web redirected related issues, no 1 of strictly same mine. here enumerate problems probabily can give big picture of project's environment: 1)i'm using devise authentication (version 3.4.1) 2)this issue appears in production environment 3)i have same versions of ruby , rails in production , development environment 4)here gems using:

actionmailer (4.2.6) actionpack (4.2.6) actionview (4.2.6) activejob (4.2.6) activemodel (4.2.6) activerecord (4.2.6) activesupport (4.2.6) acts_as_votable (0.10.0) arel (6.0.3) autoprefixer-rails (6.4.1.1, 6.3.7, 6.3.6) bcrypt (3.1.11) bigdecimal (default: 1.2.8) binding_of_caller (0.7.2) bootstrap-sass (3.2.0.2) bootstrap-tagsinput-rails (0.4.2.1) bootsy (2.2.2) bson (3.2.6) bson_ext (1.5.1) builder (3.2.2) bundler (1.12.5) bundler-unload (1.0.2) bxslider-rails (4.2.5.1) byebug (9.0.5, 9.0.3) cancancan (1.14.0) carrierwave (0.11.2) carrierwave-mongoid (0.10.0, 0.9.0) client_side_validations (4.2.3) climate_control (0.0.3) cocaine (0.5.8) coffee-rails (4.1.1) coffee-script (2.4.1) coffee-script-source (1.10.0) commonjs (0.2.7) concurrent-ruby (1.0.2) countries (1.2.5) country_select (2.5.2) currencies (0.4.2) debug_inspector (0.0.2) devise (4.2.0, 4.1.1, 3.4.1) did_you_mean (1.0.0) erubis (2.7.0) execjs (2.7.0, 2.6.0) executable-hooks (1.3.2) faraday (0.9.2) faraday_middleware (0.9.2) fileutils (0.7) font-awesome-rails (4.6.3.0) gem-wrappers (1.2.7) geoip (1.4.0) globalid (0.3.7, 0.3.6) gmaps4rails (2.1.2) google_visualr (2.5.1) haml (4.0.7) hashie (3.4.4) httpauth (0.2.1) i18n (0.7.0) i18n_data (0.7.0) image-picker-rails (0.2.4) instagram (1.1.6) io-console (default: 0.4.5) jbuilder (2.6.0, 2.5.0, 2.4.1) jquery-migrate-rails (1.2.1) jquery-rails (4.2.1, 4.1.1) jquery-slick-rails (1.6.0.2) jquery-ui-rails (5.0.5) js_regex (1.0.14) json (default: 1.8.3) jwt (1.5.4, 1.5.1, 0.1.13) kaminari (0.16.3) less (2.6.0) less-rails (2.7.1) libv8 (3.16.14.15 x86_64-linux) loofah (2.0.3) mail (2.6.4) mime-types (3.1, 3.0) mime-types-data (3.2016.0521, 3.2016.0221) mimemagic (0.3.2, 0.3.1) mini_magick (4.5.1) mini_portile2 (2.1.0, 2.0.0) minitest (5.9.0, 5.8.3) mongo (2.1.0.beta) multi_json (1.12.1, 1.12.0) multi_xml (0.5.5) multipart-post (2.0.0) mysql2 (0.4.4) nested_form (0.3.2) net-telnet (0.1.1) nokogiri (1.6.8, 1.6.7.2) oauth (0.5.1) oauth2 (1.2.0, 1.1.0, 0.8.1) omniauth (1.3.1) omniauth-facebook (4.0.0, 3.0.0, 1.4.0) omniauth-oauth (1.1.0) omniauth-oauth2 (1.4.0, 1.0.3) omniauth-twitter (1.2.1) origin (2.2.0) orm_adapter (0.5.0) paperclip (5.0.0.beta2) passenger (5.0.28) pdf-core (0.6.1) pg (0.18.4) pkg-config (1.1.7) power_assert (0.2.6) prawn (2.1.0) prawn-table (0.2.2) prawnto_2 (0.2.6) psych (default: 2.0.17) rack (1.6.4) rack-pjax (0.8.0) rack-test (0.6.3) rails (4.2.6) rails-api (0.4.0) rails-deprecated_sanitizer (1.0.3) rails-dom-testing (1.0.7) rails-html-sanitizer (1.0.3) rails_12factor (0.0.3) rails_admin (0.8.1) rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) railties (4.2.6) rake (11.2.2, 11.1.2, 10.4.2) rdoc (4.2.2, default: 4.2.1) recaptcha (3.2.0) ref (2.0.0) regexp_parser (0.3.3) remotipart (1.2.1) responders (2.3.0, 2.2.0) rmagick (2.15.4) rubygems-bundler (1.4.4) rubygems-update (2.6.4) rvm (1.11.3.9) safe_yaml (1.0.4) sass (3.4.22) sass-rails (5.0.6, 5.0.5, 5.0.4) sdoc (0.4.1) simple_form (3.3.1, 3.2.1) sort_alphabetical (1.0.2) spring (1.7.2, 1.7.1) sprockets (3.7.0, 3.6.3, 3.6.0) sprockets-rails (3.2.0, 3.1.1, 3.0.4) test-unit (3.1.5) therubyracer (0.12.2) thor (0.19.1) thread_safe (0.3.5) tilt (2.0.5, 2.0.4) time_difference (0.4.2) ttfunk (1.4.0) turbolinks (5.0.1, 5.0.0, 2.5.3) turbolinks-source (5.0.0) twitter-bootswatch-rails (3.3.4.0) twitter-bootswatch-rails-helpers (3.3.2.0) tzinfo (1.2.2) uglifier (3.0.2, 3.0.0) underscore-rails (1.8.3) unicode_utils (1.4.0) warden (1.2.6) web-console (2.3.0) wysiwyg-rails (2.2.4) 

finaly, here config/application.rb code:

require file.expand_path('../boot', __file__)  require "rails" # pick frameworks want: require "active_model/railtie" require "active_job/railtie" # require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie" require "rails/test_unit/railtie"  # require gems listed in gemfile, including gems # you've limited :test, :development, or :production. bundler.require(*rails.groups)  module comigo   class application < rails::application     # settings in config/environments/* take precedence on specified here.     # application configuration should go files in config/initializers     # -- .rb files in directory automatically loaded.      # set time.zone default specified zone , make active record auto-convert zone.     # run "rake -d time" list of tasks finding time zone names. default utc.     # config.time_zone = 'central time (us & canada)'      # default locale :en , translations config/locales/*.rb,yml auto loaded.     # config.i18n.load_path += dir[rails.root.join('my', 'locales', '*.{rb,yml}').to_s]     # config.i18n.default_locale = :de     config.action_view.javascript_expansions[:defaults] = %w(jquery.min jquery_ujs)   end 

thanks, hope can me. stuck in problem several hours!

arieljuod helped me solve issue. made sure lines added in assets/javascripts/application.js in following order:

//= require jquery //= require jquery_ujs 

and changed config/application.rb code following:

require file.expand_path('../boot', __file__)  require "rails" # pick frameworks want: require "active_model/railtie" require "active_job/railtie" # require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie" require "rails/test_unit/railtie"  # require gems listed in gemfile, including gems # you've limited :test, :development, or :production. bundler.require(*rails.groups)  module comigo   class application < rails::application     # settings in config/environments/* take precedence on specified here.     # application configuration should go files in config/initializers     # -- .rb files in directory automatically loaded.      # set time.zone default specified zone , make active record auto-convert zone.     # run "rake -d time" list of tasks finding time zone names. default utc.     # config.time_zone = 'central time (us & canada)'      # default locale :en , translations config/locales/*.rb,yml auto loaded.     # config.i18n.load_path += dir[rails.root.join('my', 'locales', '*.{rb,yml}').to_s]     # config.i18n.default_locale = :de     #config.action_view.javascript_expansions[:defaults] = %w(jquery.min jquery_ujs)   end 

fast solution, took me several hours :d


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -