Requirejs-rails only working in debug mode

127 Views Asked by At

I have created a small project with rails and added the requirejs-rails gem. I have set it up as required and while running assets:precompile, it fails when requirejs-rails tries to compile the javascript resources. However, oddly enough, the assets:precompile seems to work when in debug mode. Unfortunately, I need it to run in non-debug mode so it can be properly deployed on Heroku. Below is the error and stack trace. Any one encountered this? More importantly, any solution to this?

/home/whyves/.rvm/rubies/ruby-2.1.2/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/whyves/RubymineProjects/test2/bin/spring rake --trace assets:precompile ** Invoke assets:precompile (first_time) ** Invoke assets:environment (first_time) ** Execute assets:environment ** Invoke environment (first_time) ** Execute environment ** Invoke requirejs:precompile:external (first_time) ** Invoke requirejs:test_node (first_time) ** Execute requirejs:test_node ** Execute requirejs:precompile:external /home/whyves/.rvm/rubies/ruby-2.1.2/bin/ruby rake --trace assets:precompile requirejs:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace /home/whyves/.rvm/rubies/ruby-2.1.2/bin/ruby: No such file or directory -- rake --trace assets:precompile (LoadError) rake aborted! Command failed with status (1): [/home/whyves/.rvm/rubies/ruby-2.1.2/bin/ru...] /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:54:inblock in create_shell_runner' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in call' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:45:insh' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils_ext.rb:37:in sh' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:82:inruby' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils_ext.rb:37:in ruby' /home/whyves/.rvm/gems/ruby-2.1.2/gems/requirejs-rails-0.9.3/lib/tasks/requirejs-rails_tasks.rake:19:inruby_rake_task' /home/whyves/.rvm/gems/ruby-2.1.2/gems/requirejs-rails-0.9.3/lib/tasks/requirejs-rails_tasks.rake:86:in block (3 levels) in <top (required)>' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:incall' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:in block in execute' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:ineach' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:in execute' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain' /home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:172:ininvoke_with_call_chain' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:201:in block in invoke_prerequisites' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:199:ineach' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:199:in invoke_prerequisites' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:178:inblock in invoke_with_call_chain' /home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:172:ininvoke_with_call_chain' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:165:in invoke' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:150:ininvoke_task' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in block (2 levels) in top_level' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:ineach' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in block in top_level' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:115:inrun_with_threads' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:100:in top_level' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:78:inblock in run' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:176:in standard_exception_handling' /home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:75:inrun' /home/whyves/RubymineProjects/test2/bin/rake:8:in <top (required)>' /home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:inload' /home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in block in load' /home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:inload_dependency' /home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in load' /home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire' /home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' -e:1:in' Tasks: TOP => assets:precompile => requirejs:precompile:external

Process finished with exit code 1

`

1

There are 1 best solutions below

0
On BEST ANSWER

I have found the problem, it is not with rails or requirejs-rails. The problem lies with my IDE (RubyMine). When I precompile from a command window, it works but when I launch the task from RubyMine, it fails!