Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install issue - TinyMCE JS files not installed? #40

Closed
zetlan opened this issue Feb 7, 2012 · 9 comments
Closed

install issue - TinyMCE JS files not installed? #40

zetlan opened this issue Feb 7, 2012 · 9 comments

Comments

@zetlan
Copy link

zetlan commented Feb 7, 2012

I'm probably missing something, but followed the directions in the Readme to add tinymce-rails to my gemfile, then run bundle update. So, now the gem is installed, but it doesn't appear that any of the tinymce JS appears anywhere in my asset pipeline.

Is there a require, an extra path, or some extra installation I'm supposed to do beyond what's listed in the Readme? Am I supposed to separately install the TinyMCE JS from TinyMCE? If so ... does it matter what version I grab?

@spohlenz
Copy link
Owner

spohlenz commented Feb 7, 2012

The tinymce-rails paths should automatically be added to your asset paths when running in development mode (make sure to restart the server). In production mode, you'll need to run rake assets:precompile to build the assets into public/assets.

Are you getting any particular errors?

@zetlan
Copy link
Author

zetlan commented Feb 8, 2012

It's a file not found error, pasted below -

Sprockets::FileNotFound in Home#index

Showing /Users/scott/Sites/culture-engine/app/views/layouts/index.html.erb where line #7 raised:

couldn't find file 'tinymce-jquery'
(in /Users/scott/Sites/culture-engine/app/assets/javascripts/application.js:9)

I can get you more detailed info tomorrow if you'd like.

On Feb 7, 2012, at 5:57 PM, Sam Pohlenz wrote:

The tinymce-rails paths should automatically be added to your asset paths when running in development mode (make sure to restart the server). In production mode, you'll need to run rake assets:precompile to build the assets into public/assets.

Are you getting any particular errors?


Reply to this email directly or view it on GitHub:
#40 (comment)

@spohlenz
Copy link
Owner

spohlenz commented Feb 8, 2012

@zetlan You're not the only one to have experienced this, but for the life of me I haven't been able to reproduce it myself.

What would be really helpful is if you could create a GitHub repo with an app that experiences the issue (including Gemfile.lock). I'd really like to track this one down.

@zetlan
Copy link
Author

zetlan commented Feb 8, 2012

Okay, I think I know what's going on. In trying to reproduce the error, I discovered I couldn't — and then I realized I was serving the test app via WEBrick (rails server) but serving my app via Phusion Passenger ("mod_rails" inside apache).

Restarting the apache server solved the initial issue; now Passenger knows about the new gem and its asset path. I'm now getting bit by issue #39, but I'll work that out separately.

Interestingly, the usual method of restarting the app (touch tmp/restart.txt) does not appear to be sufficient; I actually had to restart apache.

@raykin
Copy link

raykin commented Feb 9, 2012

In development env, if I set config.serve_static_assets = false, the langs/en.js and editor_template.js will be missing.
Maybe you should check Rails.application.config.serve_static_assets in console.
I think it should be true in development and false in production.

@PerfectlyNormal
Copy link

Probably unrelated, but might provide a clue or help someone else.

I developed a small plugin for TinyMCE and packaged it as a gem, with tinymce-rails as a dependency. Added my plugin to the applications Gemfile, and removed tinymce-rails, since it would get pulled in by my plugin. It did, but assets did not, and I started getting this exact error. Only when I added tinymce-rails back to my application Gemfile did it fix itself again.

@spohlenz
Copy link
Owner

spohlenz commented Mar 7, 2012

@PerfectlyNormal That's correct. Adding require 'tinymce-rails' to the top of your own engine should also do the trick.

@zetlan
Copy link
Author

zetlan commented Oct 17, 2013

Two years later, and the issue has cropped up again. This time, I think I've figured it out: the tagged versions in GitHub and on RubyGems don't include the advanced theme, which my app relies on.

My short-term workaround was to clone master and copy the files out of tinymce-rails/app/assets/javascripts and tinymce-rails/vendor/assets/javascripts into my app/assets/javascripts, so they're all available at the latest version in my own asset pipeline. But is there any reason why you don't have all the files in the right place in the gem?

I would love it if you could:

  1. make sure the right files are in the vendor/assets and app/assets inside the gem
  2. update GitHub with tags that match what you have out in RubyGems
  3. push a new version of the gem (4.0.9?) that includes all the right source code

and then I can go back to just using what's in the gem, instead of having to maintain my own copies of these javascripts. For now, though, I'm freezing to 4.0.2 (since that's what I can see in GitHub).

@spohlenz
Copy link
Owner

@zetlan The advanced theme was removed from TinyMCE 4.0 and has been replaced with the modern theme. If you're relying on the advanced them, you will want to downgrade to the 3.5 branch (http://rubygems.org/gems/tinymce-rails/versions/3.5.9).

I do need to update the releases list though. I thought I had that set up automatically but apparently not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants