Requirejs-rails仅在调试模式下工作

时间:2014-11-11 03:33:33

标签: requirejs-rails

我创建了一个带rails的小项目,并添加了requirejs-rails gem。我已经根据需要进行了设置,并且在运行资产时:预编译,当requirejs-rails尝试编译javascript资源时,它会失败。然而,奇怪的是,资产:预编译似乎在调试模式下工作。不幸的是,我需要它在非调试模式下运行,以便它可以在Heroku上正确部署。下面是错误和堆栈跟踪。有谁遇到过这个?更重要的是,任何解决方案?

create_shell_runner'中的

/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:in阻止 /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:in sh&#39; /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:in ruby​​&#39; /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:in ruby​​_rake_task&#39; /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:in来电&#39; /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:in每个&#39; /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:in阻止invoke_with_call_chain&#39; /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:in invoke_with_call_chain&#39; /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:in每个&#39; /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:in阻止invoke_with_call_chain&#39; /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:in invoke_with_call_chain&#39; /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:in invoke_task&#39; /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:in每个&#39; /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:in run_with_threads&#39; /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:in阻止运行&#39; /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:in run&#39; / home / why / 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:in load&#39; /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:in load_dependency&#39; /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:in要求&#39; /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&#39; 任务:TOP =&gt; assets:precompile =&gt; requirejs:预编译:外部

使用退出代码1完成处理

`

1 个答案:

答案 0 :(得分:0)

我发现了问题,它不是使用rails或requirejs-rails。问题出在我的IDE(RubyMine)上。当我从命令窗口进行预编译时,它可以工作但是当我从RubyMine启动任务时,它会失败!