PANmedia / raptor-editor-rails

Get Raptor Editor into your Rails apps
MIT License
17 stars 6 forks source link

Newbie problem: can't find file 'raptor' #5

Closed lionelrudaz closed 11 years ago

lionelrudaz commented 11 years ago

Hi,

First of all, thanks for your tremendous work. This helps me a lot for my project.

I get a newbie error when I'm installing Raptor in my RoR application.

Error:

Sprockets::FileNotFound in Home#index

Showing /Users/lionelrudaz/Dropbox/Dev/ror/myteam2/app/views/layouts/application.html.erb where line #61 raised:

couldn't find file 'raptor'
  (in /Users/lionelrudaz/Dropbox/Dev/ror/myteam2/app/assets/javascripts/application.js:16)
Extracted source (around line #61):

58:     <!-- Javascripts
59:     ================================================== -->
60:     <!-- Placed at the end of the document so the pages load faster -->
61:     <%= javascript_include_tag "application" %>
62:   </body>
63: </html>

Here's the GitHub repo: https://github.com/lionelrudaz/myteam2

Do you know where this comes from?

Thanks in advance.

Cheers,

Lionel

tristanm commented 11 years ago

Hi Lionel, thanks for the kind words, I'm pleased this little Gem is a help.

From a quick look through the most likely points of failure (Gemfile, Gemfile.lock, application.js and application.html) it looks like the gem is installed correctly and your code to include Raptor is good. I hate to ask, but did you restart the app after you ran bundle install?

lionelrudaz commented 11 years ago

Hi Tristan,

Thanks for your quick reply.

What a shame! Of course I didn't. Sorry, I was in a rush at work, did that on my break time, wasn't focused at all.

Anyway, I still get a JS error:

Uncaught TypeError: Object [object Object] has no method 'editor' application.js:76
(anonymous function) application.js:76
fire jquery.js:1076
self.fireWith jquery.js:1194
jQuery.extend.ready jquery.js:436
DOMContentLoaded jquery.js:950

On line 76 of application.js:

$('.editor').editor({
            autoEnable: true,
            ui: {
                textBold: true,
                textItalic: true,
                textUnderline: true,
                textStrike: true,
                quoteBlock: true,
                fontSizeInc: true,
                fontSizeDec: true
            },
            plugins: {
                dock: {
                    docked: true,
                    dockToElement: true,
                    persist: false
                },
                placeholder: {
                    content: '[Your comment here]'
                }
            }
    });

I've tried with only .editor() without further options, tried with textareas, divs, etc.

Do you know what can be the reason?

Cheers,

tristanm commented 11 years ago

Hi Lionel

Based on your Gemfile.lock you're using less than the minimum requirements for jQuery and jQuery UI.

I've just made a new release that adds minimum dependencies for the jquery-rails and jquery-ui-rails gems so grab an update and let me know how you go.

bundle update raptor-editor-rails jquery-rails jquery-ui-rails

(and don't forget to restart!)

Oh, speaking of which, I added a note to the README about restarting :)

Cheers Tristan

lionelrudaz commented 11 years ago

Hi Tristan,

Still get the error.

I've made this:

bundle update raptor-editor-rails jquery-rails jquery-ui-rails
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.3) 
Using i18n (0.6.1) 
Using multi_json (1.6.1) 
Using activesupport (3.2.10) 
Using builder (3.0.4) 
Using activemodel (3.2.10) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.2.2) 
Using actionpack (3.2.10) 
Using mime-types (1.21) 
Using polyglot (0.3.3) 
Using treetop (1.4.12) 
Using mail (2.4.4) 
Using actionmailer (3.2.10) 
Using arel (3.0.2) 
Using tzinfo (0.3.35) 
Using activerecord (3.2.10) 
Using activeresource (3.2.10) 
Using addressable (2.3.2) 
Using batch_translations (0.1.3) 
Using bcrypt-ruby (3.0.1) 
Using rack-ssl (1.3.3) 
Using json (1.7.7) 
Using rdoc (3.12.1) 
Using thor (0.17.0) 
Using railties (3.2.10) 
Using bootstrap-colorpicker-rails (0.1) 
Using bootstrap-datepicker-rails (0.6.35) 
Using sass (3.2.0) 
Using bootstrap-sass (2.2.2.0) 
Using breadcrumbs_on_rails (2.2.0) 
Using bundler (1.2.1) 
Using cancan (1.6.8) 
Using nokogiri (1.5.5) 
Using ffi (1.1.5) 
Using childprocess (0.3.5) 
Using libwebsocket (0.1.5) 
Using rubyzip (0.9.9) 
Using selenium-webdriver (2.25.0) 
Using xpath (0.1.4) 
Using capybara (1.1.2) 
Using carrierwave (0.6.2) 
Using coffee-script-source (1.3.3) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using coffee-rails (3.2.2) 
Using diff-lcs (1.1.3) 
Using gherkin (2.11.1) 
Using cucumber (1.2.1) 
Using cucumber-rails (1.3.0) 
Using daemons (1.1.9) 
Using database_cleaner (0.8.0) 
Using orm_adapter (0.4.0) 
Using warden (1.2.1) 
Using devise (2.1.2) 
Using rspec-core (2.11.1) 
Using rspec-expectations (2.11.2) 
Using rspec-mocks (2.11.2) 
Using rspec (2.11.0) 
Using email_spec (1.2.1) 
Using eventmachine (1.0.0) 
Using excon (0.16.3) 
Using factory_girl (4.0.0) 
Using factory_girl_rails (4.0.0) 
Using rails (3.2.10) 
Using figaro (0.4.1) 
Using paper_trail (2.6.4) 
Using globalize3 (0.3.0) 
Using heroku-api (0.3.5) 
Using launchy (2.1.2) 
Using netrc (0.7.7) 
Using rest-client (1.6.7) 
Using heroku (2.32.2) 
Using jquery-rails (2.2.1) 
Using jquery-ui-rails (4.0.1) 
Using kaminari (0.14.1) 
Using libv8 (3.3.10.4) 
Using subexec (0.2.2) 
Using mini_magick (3.4) 
Using pg (0.14.1) 
Using pg_search (0.5.7) 
Using raptor-editor-rails (0.2.2) 
Using rolify (3.2.0) 
Using rspec-rails (2.11.0) 
Using sass-rails (3.2.5) 
Using therubyracer (0.10.2) 
Using thin (1.5.0) 
Using uglifier (1.2.7) 
Using wicked_pdf (0.9.2) 
Using wkhtmltopdf-binary (0.9.9.1) 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

I have this in application.js

//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require raptor
//= require bootstrap
//= require_tree .

And this in the generated HTML

<!-- Javascripts
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script>
<script src="/assets/raptor.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-transition.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-affix.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-alert.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-button.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-carousel.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-collapse.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-dropdown.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-modal.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-scrollspy.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-tab.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-tooltip.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-popover.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-typeahead.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap.js?body=1" type="text/javascript"></script>
<script src="/assets/clubs.js?body=1" type="text/javascript"></script>
<script src="/assets/event_categories.js?body=1" type="text/javascript"></script>
<script src="/assets/events.js?body=1" type="text/javascript"></script>
<script src="/assets/home.js?body=1" type="text/javascript"></script>
<script src="/assets/languages.js?body=1" type="text/javascript"></script>
<script src="/assets/players.js?body=1" type="text/javascript"></script>
<script src="/assets/presences.js?body=1" type="text/javascript"></script>
<script src="/assets/programs.js?body=1" type="text/javascript"></script>
<script src="/assets/seasons.js?body=1" type="text/javascript"></script>
<script src="/assets/states.js?body=1" type="text/javascript"></script>
<script src="/assets/teams.js?body=1" type="text/javascript"></script>
<script src="/assets/tours.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-colorpicker.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/core.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.bg.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.br.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.ca.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.cs.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.da.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.de.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.el.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.es.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.fi.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.fr.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.he.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.hr.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.id.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.is.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.it.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.ja.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.kr.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.lt.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.lv.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.ms.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.nb.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.nl.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.pl.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.pt.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.ro.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.rs.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.ru.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.sk.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.sl.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.sv.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.sw.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.th.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.tr.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.uk.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-datepicker/index.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>

I've also tried to include jquery.ui.all instead of jquery-ui in application.js like suggested here: https://github.com/joliss/jquery-ui-rails

What's weird is that it looks like I have jQuery UI v1.9.2

/*! jQuery UI - v1.9.2 - 2012-11-23
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */

Do I miss anything?

Thanks again for your support.

Cheers,

tristanm commented 11 years ago

Alright, try replacing application.js (temporarily) with the one at https://gist.github.com/tristanm/55d72141404a088801ea. I just want to make sure that Bootstrap or one of your other scripts isn't messing with things.

lionelrudaz commented 11 years ago

Hi Tristan,

Same issue. But I'm sure this is due to jquery-ui.js which is stucked to 1.9.2.

Do you know how I can have 1.10?

Cheers,

Le mercredi, 20 février 2013 à 20:36, Tristan McHardie a écrit :

Alright, try replacing application.js (temporarily) with the one at https://gist.github.com/tristanm/55d72141404a088801ea. I just want to make sure that Bootstrap or one of your other scripts isn't messing with things.

— Reply to this email directly or view it on GitHub (https://github.com/PANmedia/raptor-editor-rails/issues/5#issuecomment-13851692).

lionelrudaz commented 11 years ago

I've also tried to change the call in application.js with //= require jquery.ui.all

I have jQuery UI in version 1.10, but still the error.

Sorry about that.

Let me know if I can give you more information.

Cheers,

Le vendredi, 22 février 2013 à 15:56, Lionel Rudaz a écrit :

Hi Tristan,

Same issue. But I'm sure this is due to jquery-ui.js which is stucked to 1.9.2.

Do you know how I can have 1.10?

Cheers,

Le mercredi, 20 février 2013 à 20:36, Tristan McHardie a écrit :

Alright, try replacing application.js (temporarily) with the one at https://gist.github.com/tristanm/55d72141404a088801ea. I just want to make sure that Bootstrap or one of your other scripts isn't messing with things.

— Reply to this email directly or view it on GitHub (https://github.com/PANmedia/raptor-editor-rails/issues/5#issuecomment-13851692).

tristanm commented 11 years ago

Can you please update your repo with your latest changes or paste in Gemfile.lock.

lionelrudaz commented 11 years ago

Repo updated. Any ideas?

Cheers,

Le dimanche, 24 février 2013 à 20:40, Tristan McHardie a écrit :

Can you please update your repo with your latest changes or paste in Gemfile.lock.

— Reply to this email directly or view it on GitHub (https://github.com/PANmedia/raptor-editor-rails/issues/5#issuecomment-14014388).

ymatagne commented 11 years ago

Hello,

I have the same problem...

Uncaught TypeError: Object [object Object] has no method 'editor'

tristanm commented 11 years ago

Hi, working on some proper tests so we can get to the bottom of it. Stand by.

tristanm commented 11 years ago

The original issue has now been solved but it has highlighted a new problem along the way. A new issue has been raised that is more relevant to the problem now at hand.