Skip to content

Couldn't find file 'react' when precompiling assets #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
steadicat opened this issue Mar 10, 2014 · 16 comments
Closed

Couldn't find file 'react' when precompiling assets #30

steadicat opened this issue Mar 10, 2014 · 16 comments

Comments

@steadicat
Copy link

If I add //= require react to any JS file, everything works fine until I run rake assets:precompile, at which point I get a couldn't find file 'react' error.

I have this in my production.rb:

config.react.variant = :production
config.react.addons = true

And this in my development.rb:

config.react.variant = :development
config.react.addons = true

I'm running Rails 3.2.17 with Ruby 1.9.3p484.

Full output of the rake assets:precompile command:

> RAILS_ENV=production rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/stefano/.rbenv/versions/1.9.3-p484/bin/ruby /Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Invoke assets:cache:clean (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Execute assets:cache:clean
** Execute assets:precompile:all
rake aborted!
couldn't find file 'react'
  (in /Users/stefano/Work/Web/app/assets/javascripts/statusboard.module.js.jsx:3)
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:102:in `resolve'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:142:in `require_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:215:in `process_require_directive'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:165:in `block in process_directives'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:163:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:163:in `process_directives'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:97:in `evaluate'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/sprockets/unprocessed_asset.rb:14:in `initialize'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/base.rb:16:in `new'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/base.rb:16:in `block in build_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:270:in `circular_call_protection'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/base.rb:14:in `build_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/index.rb:14:in `find_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/bundled_asset.rb:12:in `initialize'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/base.rb:22:in `new'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/base.rb:22:in `build_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/index.rb:14:in `find_asset'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/static_compiler.rb:32:in `block in compile'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/sprockets_overrides/static_compiler.rb:29:in `compile'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/tasks/assets.rake:108:in `internal_precompile'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/turbo-sprockets-rails3-0.3.10/lib/turbo-sprockets/tasks/assets.rake:115:in `block (3 levels) in <top (required)>'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<main>'
Tasks: TOP => assets:precompile:all
rake aborted!
Command failed with status (1): [/Users/stefano/.rbenv/versions/1.9.3-p484/...]
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:55:in `block in create_shell_runner'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `call'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `sh'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `sh'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils.rb:82:in `ruby'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `ruby'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/Users/stefano/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<main>'
Tasks: TOP => assets:precompile
@jtmalinowski
Copy link
Collaborator

I'll look into it tomorrow, thanks for reporting.

@jtmalinowski
Copy link
Collaborator

I tried to duplicate your stack as precisely as I could to no avail yet.
Would you mind if I asked you to prepare a repro case?

@steadicat
Copy link
Author

Our team just upgraded to Rails 4 and this now works. I don’t have much time to dig into this right now unfortunately. It sounds like I’m the only person running into this, so you can just close this as a wontfix. Thanks for looking into this!

@jtmalinowski
Copy link
Collaborator

Hi, we are supporting rails 3.2! Could you maybe post your Gemfile.lock if it's not secret? (The one from when the problem occurred)

@steadicat
Copy link
Author

Here's the Gemfile.lock from before our Rails 4 port: https://gist.github.com/steadicat/958186cbb9abae280411 Hope it helps!

@zpao
Copy link
Member

zpao commented Mar 14, 2014

I completely missed #23, but it looks likely to be the same issue and has a solution.

@acrispino
Copy link

I'm using ruby-2.1.1 with rails-3.2.17 and this script reproduces the problem for me:

#!/bin/sh
rails _3.2.17_ new rtest
cd rtest
echo 'gem "react-rails", "~> 0.9.0.0"' >> Gemfile
bundle install
echo "//= require react" >> app/assets/javascripts/application.js
rake assets:precompile --trace

adding

config.assets.initialize_on_precompile = true

doesn't seem to make a difference

@jtmalinowski
Copy link
Collaborator

@acrispino thanks for the report! It is just because you didn't set the variant, in 1.0.x we'll default to a variant based on an environment, but in 0.x you need to set it explicitly in config/environments/production|development.rb:
config.react.variant = :development or :production appropriately.

I can't reproduce @steadicat's issue though.

@jtmalinowski
Copy link
Collaborator

We'll reopen if someone runs into this in the future.

@stockandawe
Copy link

@JakubMal, we are running in to the exact same issue that @steadicat reported.

We are using Rails 3.2.13 and ruby 1.9.3p194.
Full output of rake assets:precompile

$ RAILS_ENV=production rake assets:precompile --trace
WARNING: Nokogiri was built against LibXML version 2.9.1, but has dynamically loaded 2.9.0
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/rutul/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
WARNING: Nokogiri was built against LibXML version 2.9.1, but has dynamically loaded 2.9.0
** 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 tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
couldn't find file 'react'
  (in /Users/rutul/BrightFunds/brightfunds/app/assets/javascripts/application.js:1)
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/context.rb:102:in `resolve'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/context.rb:142:in `require_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:215:in `process_require_directive'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:165:in `block in process_directives'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:163:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:163:in `process_directives'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/directive_processor.rb:97:in `evaluate'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/tilt-1.3.7/lib/tilt/template.rb:77:in `render'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/processed_asset.rb:12:in `initialize'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `new'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `block in build_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:270:in `circular_call_protection'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:248:in `build_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:16:in `initialize'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:19:in `block in compile'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/rutul/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/rutul/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/bin/rake:19:in `load'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/Users/rutul/.rvm/rubies/ruby-1.9.3-p194/b...]
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `call'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `sh'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `sh'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/file_utils.rb:80:in `ruby'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `ruby'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/rutul/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/bin/rake:19:in `load'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/bin/rake:19:in `<main>'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/bin/ruby_noexec_wrapper:14:in `eval'
/Users/rutul/.rvm/gems/ruby-1.9.3-p194@brightfundsv2/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile

@jtmalinowski
Copy link
Collaborator

@stockandawe are you sure you have config.react.variant = :development or :production in environment?

@stockandawe
Copy link

@JakubMal, I have config.react.variant = :production in config/environments/production.rb and config.react.variant = :development in config/environments/development.rb

@ku1ik
Copy link

ku1ik commented Apr 11, 2014

I have the exact same issue. I'm using 0.9 and I have specified variant in both development.rb and production.rb (https://gitorious.org/gitorious/mainline/source/596c64564bfb4cb13ab5cdfccd4c585e3de58732:config/environments/production.rb#L65). Rails 3.2.16.

@Migoo
Copy link

Migoo commented Mar 7, 2016

Hi,

I'm having a similar with file I want to be precompiled. I put my button.js.jsx in assets/javascripts/components/common/button.js.jsx

and in our bundle file I require it like that:
//= require components/common/button.js.jsx

In my development.rb I have:
config.react.variant = :development
config.react.addons = true

We are using Rails 4.2.5.2 and react-rails 1.6.2 with ruby 2.3.0p0

When I reload the page I got the following error:
couldn't find file 'components/common/button.js.jsx' with type 'application/javascript'

Any help is welcoming, actually we are processing the file with gulp and it will be a great improvement if we can use the assets pipelines for it.

Thanks a lot for helping.

@aisrael
Copy link

aisrael commented Sep 8, 2016

I know this issue is closed but am having a similar issue as @Migoo

@rmosolgo
Copy link
Member

rmosolgo commented Sep 8, 2016

In general, shouldn't you require without file extension? eg

//= require components/common/button

Does that work any better? Or does it raise a different error? Also, could you report your sprockets version? It seems like we're still tracking down compatibility issues with Sprockets 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants