Topic: JS tinymce-rails js file not getting included after deployment

I  installed tinymce-rails gem, and included the coffeescript include so that the wysiwyg editor appears on a particular view. I added it to assets/javascripts/application.js file as shown below;

//= require tinymce-jquery

This works great when running on webrick on local machine. It worked fine in the development environment, and after tweaking a couple of variables in the production.rb file it started working locally as well in production environment.

However once I deploy to my webhost (webbynode) and open the view that the editor is supposed to appear in, the javascript for tinymce does not get included. I played a bit with some of the variables in the environment/production.rb file which seemed to make a difference locally, but it did not make a difference in the hosted environment. Any ideas on this?

Re: JS tinymce-rails js file not getting included after deployment

Did (or can) you run this on your production site?

bundle exec rake assets:precompile

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: JS tinymce-rails js file not getting included after deployment

Well, I keep getting this in response;

rake aborted!
Operation not permitted - /var/rapp/pskr2/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4

I can google it and get back to you. Thanks for taking the time to answer, I really appreciate it.

Re: JS tinymce-rails js file not getting included after deployment

All is not lost,  rails has thought this through,  just Google 'Rails assets pipeline'  there is an explanation of what to do if you don't have the proper permissions with your hosting provider.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: JS tinymce-rails js file not getting included after deployment

It worked! Thank you much. I suspect I either need to read more on the asset pipeline OR I could just do things the old fashioned way and include the script via html tag inside the controller/view I want it to appear in. It might seem like I am missing a good opportunity to take advantage of some of the nice features rails provides, but when I can't easily resolve an issue like this myself it might not be worth the trouble.

I really appreciate your time Mr. Hodges.

Re: JS tinymce-rails js file not getting included after deployment

The advantage of using the asset pipeline is that will automatically minify your javascript and concatenate all of them so there is only one server request to grab all the javascript needed for any one page.  faster page load.

That's not to say you should never do the old fashioned method of putting javascript inside of <script type=text/javascript></script>

I do both.  Usually if I have javascript that is clearly only relative to a specific view,  it is usually small, and minifying it won't save you that much,  plus it get's loaded in a single shot when the page loads.

BIG complex javascript files should be served through assets pipeline, especially if there are lot's of them.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.