How to include a vendor multi-module JS library in Rails?

Hello everyone,

I am trying to include a JS library (GeoExt) in an existing Rails application. Following the Asset Pipeline guide, I did:

  • Created the folder /vendor/assets/javascripts/GeoExt to where I copied all the JS modules.

  • Created the file /vendor/assets/javascripts/GeoExt/index.js containing the //= require_tree . directive.

  • In the application.js file included the directive //= require GeoExt.

With this setting I am getting a 404 error every time a module from this library is referenced. What am I doing wrong?

Thank you.

I have not done exactly that. Does it work if you put GeoExt
immediately under assets so /vendor/assets/GeoExt?


You probably have same problem that I was writing in this post.

Javascript library is trying to load modules in runtime. Your chance is
to place javascript files directly to the place (url) where they are
required. Look at the url in error and put javascript files there.


Hi Colin,

No, moving the library a folder up doesn’t not change the outcome.

Thank you,


Hi Damjan,

These URLs are point to /datasets/mass_import, a path that does not exist in this project:


If you are correct, then I a do not have much of an idea where to include the library.

Thank you,