Closed Rakoth closed 10 years ago
@Rakoth Hey, thanks! Stuff like this goes a long way towards helping me fix this problem.
+1 Im getting this same issue with rails 4.0 when deploying to heroku.
That did not work for me, however config.cache_classes does seem to be the issue. Originally it was set to true but when changing that to false, precomplication was successful. Seems like the issue is with config.cache_classes = false in engine.rb being overidden by the main app config?
@rmdydo Please paste a dump pf your Gemfile.lock
.
@rmdydo It looks like requirejs-rails
is pointing to aar0nTw/requirejs-rails
. I'm assuming that you tried out my fork?
@rmdydo Also, could you try bundle exec rake assets:precompile
locally? You reported the problem as manifesting when deploying to Heroku.
@Rakoth FYI, your requirejs-rails-test-app project compiles fine after the changes. Please confirm.
@carsomyr confirmed, its work!
@rmdydo Let me know if you manage to reproduce the problem with a minimal set of gems while locally running bundle exec rake assets:precompile
.
I cloned Rakoth's test app and am still getting while running bundle exec rake assets:precompile
GROUPS=assets rake aborted! Asset compilation with node failed with error:
/home/rdydo/.rvm/gems/ruby-2.1.2/bundler/gems/requirejs-rails-03aab50dd103/lib/tasks/requirejs-rails_tasks.rake:139:in block (3 levels) in <top (required)>' Tasks: TOP => requirejs:precompile:all => requirejs:precompile:run_rjs (See full trace by running task with --trace) rake aborted! Command failed with status (1): [/home/rdydo/.rvm/rubies/ruby-2.1.2/bin/rub...] /home/rdydo/.rvm/gems/ruby-2.1.2/bundler/gems/requirejs-rails-03aab50dd103/lib/tasks/requirejs-rails_tasks.rake:19:in
ruby_rake_task'
/home/rdydo/.rvm/gems/ruby-2.1.2/bundler/gems/requirejs-rails-03aab50dd103/lib/tasks/requirejs-rails_tasks.rake:86:in `block (3 levels) in <top (required)>'
Tasks: TOP => assets:precompile => requirejs:precompile:external
(See full trace by running task with --trace)
@rmdydo You have to bundle update
to pull down the latest changes on requirejs-rails master
.
The fix does work for me on Rakoths test app using my orignal gemfile with both rails 3.2 and 4.0 but this was after commenting out the asset_sync gem, which would fail due to it not being configured. In my original project I do still get the immutable index exception duing precompile and the only gem file difference here is the asset_sync gem. Im guessing asset_sync is the culprit?
@rmdydo Make sure that config.cache_classes
doesn't appear in your asset_sync.rb
file.
@rmdydo Any luck getting it to work? What if you include asset_sync
in your Gemfile
but take no steps to configure it? I'm asking because you could try adding in one configuration setting after another, until one breaks precompilation.
No luck so far. I dont think it is asset_sync because I was able to get Rakoth's test app to successfully deploy with asset_sync configured. I also use ActiveAdmin and looked into this because that still uses sproket directives for js but after completely removing that I was still not able to successfully precompile. Im guessing its something specific about my app config or a gem that I'm using that is causing the issue. I plan to continue to rip out stuff until it works.
@rmdydo How about this idea: Print some info right before these lines of code. If you catch sprockets-rails freezing the environment before requirejs-rails gets to run, that's the reason.
In rails 3.2 assets precompilation task failing with error message: "TypeError: can't modify immutable index". Here is example app for this problem: https://github.com/Rakoth/requirejs-rails-test-app I commented on #176 which introduce this error, but no activity there, so I decided create new issue.