Ruby on Rails Wednesday, June 27, 2012



On Wednesday, June 27, 2012 2:36:33 AM UTC-4, Ylan wrote:



On Tuesday, June 26, 2012 9:02:21 PM UTC-7, Vell wrote:


On Tuesday, June 26, 2012 11:22:56 PM UTC-4, Vell wrote:


On Tuesday, June 26, 2012 11:14:14 PM UTC-4, Vell wrote:
Hello all,

I seem to be running into an issue where jquery seems to be working fine in my development environment but when I load it to my production environment it does not work. There are some menus that I am trying to hide when the web page loads but when they page loads they are there in plain site. When I launch firebug and run the same code in console it works without any issue so I have wonder if there is a different way I need to precompile the assets to get everything to load?

UPDATE: interestingly enough I ran `rake assets:precompile` and I didn't get any errors prior to submitting this topic. I decided to run rake `assets:precompile:all` and I hit an error:

rake aborted!
couldn't find file 'jquery'

To make sure I ran rake `assets:precompile` again to see if I wouldn't get any errors and I again hit another error but it is different from the error I got above:

rake aborted!
Invalid CSS after "     background:url(": expected expression (e.g. fr, 2n+1), was "<%= asset_path ..."
 
I though the jquery-rails gem was supposed to load jquery for me. Is it that I don't need to include jquery and jquery_ujs in my application.js file?

UPDATE 2: Changing my css file to css.erb fixed my css error but I am now back to my jquery error.  I have confirmed that when I run `rake assets:precompile` I do not get an error about jquery but when I run `rake assets:precompile:all` I get an error about jquery. What would make it so that one complains the other does not? and also do I need to include jquery and jquery_ujs if I am using the jquery-rails gem?

 Val, 

Your Gemfile looks good to me and so does your application.js. 

Are you using bundle exec rake to precompile? Can you post the error message you get about jquery?

Thanks for the response Ylan. I just now tried `bundle exec rake assets:precompile:all` and I am getting the same error about jquery.  The error I am getting is:

 rake aborted!
couldn't find file 'jquery'
  (in /home/vmcilwain/apps/test_app/app/assets/javascripts/application.js:13)

Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)

Here is what the trace outputs:

** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
couldn't find file 'jquery'
  (in /home/vmcilwain/apps/test_app/app/assets/javascripts/application.js:13)
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:100:in `resolve'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:140:in `require_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:215:in `process_require_directive'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:165:in `block in process_directives'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:163:in `each'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:163:in `process_directives'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/directive_processor.rb:97:in `evaluate'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:177:in `block in evaluate'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:174:in `each'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/context.rb:174:in `evaluate'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/processed_asset.rb:12:in `initialize'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:241:in `new'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:241:in `block in build_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:262:in `circular_call_protection'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:240:in `build_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:89:in `block in build_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/caching.rb:19:in `cache_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:88:in `build_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:163:in `find_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:56:in `find_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/bundled_asset.rb:16:in `initialize'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:244:in `new'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:244:in `build_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:89:in `block in build_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/caching.rb:19:in `cache_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:88:in `build_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:163:in `find_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/index.rb:56:in `find_asset'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:20:in `block in compile'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:212:in `block in each_logical_path'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:200:in `block (2 levels) in each_file'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each_entry'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:198:in `block in each_file'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each_file'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/sprockets-2.1.3/lib/sprockets/base.rb:210:in `each_logical_path'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:18:in `compile'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/sprockets/assets.rake:56:in `internal_precompile'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/vmcilwain/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/vmcilwain/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/home/vmcilwain/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile:primary
-- 
Ylan. 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/zDTVnpRuW8oJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment