title: RequireJs + Rails 4
body: <p>I'm new to RequireJs, so i little bit stuck with getting my rails 4 app working on production with requirejs pieces.</p>
  
  <p>I have the following:</p>
  
  <p>1) Require_rails gem</p>
  
  <pre><code>gem 'requirejs-rails'
  </code></pre>
  
  <p>2) Piece of require-js called in a middle of a html.erb file</p>
  
  <pre><code>&lt;%= requirejs_include_tag asset_url("scribe/scribe-editor.js") %&gt;
  </code></pre>
  
  <p>3) In this a file I have following</p>
  
  <pre><code>require({
    paths: {
      'scribe': 'scribe/bower_components/scribe/scribe',
      'scribe-plugin-blockquote-command': 'scribe/bower_components/scribe-plugin-blockquote-command/scribe-plugin-blockquote-command',
      'scribe-plugin-code-command': 'scribe/bower_components/scribe-plugin-code-command/scribe-plugin-code-command'
    }
  }, [
    'scribe',
    'scribe-plugin-blockquote-command',
    'scribe-plugin-code-command',
  ], function (
    Scribe,
    scribePluginBlockquoteCommand,
    scribePluginCodeCommand,
  ) {
  ...
  });
  </code></pre>
  
  <p>4) All these files located in vendor/javascripts/scribe</p>
  
  <pre><code>vendor/javascripts/scribe/scribe-editor.js
  vendor/javascripts/scribe/bower_components/scribe/scribe.js
  vendor/javascripts/scribe/bower_components/scribe/scribe/scribe-plugin-blockquote-command/scribe-plugin-blockquote-command.js
  vendor/javascripts/scribe/bower_components/scribe/scribe-plugin-code-command/scribe-plugin-code-command.js
  </code></pre>
  
  <p>5) On production I have the following code.</p>
  
  <pre><code>&lt;script src="/assets/require-21be67676bcf2b75c547dd382d849e26.js"&gt;&lt;/script&gt;
  &lt;script&gt;require.config({"baseUrl":"http://domain.com/assets","paths":{"application":"/assets/application-e720d39c2f6b94f1fd554d97b48ee312"}}); require(["http://domain.com/assets/scribe/scribe-editor-a848a8a552e89e8a8f6e9a62d10cd58f.js"]);&lt;/script&gt;
  </code></pre>
  
  <p>6) And finally, my asset.rb file:</p>
  
  <pre><code>Rails.application.config.assets.precompile += %w( 
      scribe/scribe-editor.js
  )
  </code></pre>
  
  <p>=============
  7) The problem: script editor is loaded, but all dependencies come with 404 not found.</p>
  
  <p>Thanks for your help.</p>