Hi Colin,
This seems to be a combination of problems.
I did a git diff between the master branch (which worked correctly - up
to the place where I was coding) and the working branch (which was NOT
working ;-) ). There was nothing unusual, only 4 files changed and
nothing that would cause Rails to think it was in production mode. I
somehow lost the part of the log that had that strange error message,
and it hasn't re-appeared (yet. I sure hope never).
The part of the problem where it ignored my edits seems to be two-fold.
Part of it went away when I cleared cache in my browsers, The second
seems to be that Rails is now ignoring changes in .js and .js.erb
files. It's very hard to explain, because it was processing them
yesterday till I got that weird error message.
I finally did what I threatened to do yesterday. I copied the modified
files outside the git tree and created another branch (4 for this part
of the project so far). I copied the problem files one-by-one into the
new branch, starting with routes.rb (nothing would work if the routes
were missing). Tested and it worked. I copied the controller, tested
it, and it passed. I copied the calendars.js.erb and tested it. It
failed (many alerts in the file, none activated), only the alert I put
in in calendars.coffee showed up. Deleted calendars.coffee and
restarted. No change!!!! The alert in calendars.coffee still appeared
(the file was GONE). None from the javascript file.
At this point I discovered that coffeescript is not a superset of
javascript. I copied the javascript line-for-line into a new
coffeescript file and Rails barfed. I have never used coffeescript, but
from the looks of things, I needed to learn fast.
After a few hours of editing, reading the manuals, testing and more
editing, I got the javascript translated into coffeescript.
Incidentally, in the process I totally hosed the javascript file, but
Rails didn't seem to mind. It just ignored anything I did to that
file. I'm not proficient in coffeescript, but...
In the long run, I got the thing working. There has not been an
instance of the "You need to pre-compile the javascript file".
If anything like before happens, I'll copy the appropriate log entries
and send them to you.
My new mantra is "commit early, commit often". :-D
Thanks,
Don
On 03/08/2016 03:34 AM, Colin Law wrote:
On 8 March 2016 at 05:14, Donald Ziesig <don...@ziesig.org> wrote:
Hi All!
Another problem. I am using Rails 5.0.0.beta3 with a minor javascript file
(115 lines). I have encountered the following problem several times in the
past two days. In both earlier cases, I ended up returning to the master
branch and starting over (there were very few changes in those two branches,
I hadn't gotten very far). Now I have it very close to being finished and I
can't seem to get it to work like it was a few minutes ago. Unfortunately,
I have not committed my changes frequently enough (dumb, I know) so I will
have to start over again. (I can copy the edited files out of the git tree,
create a new branch and copy them back, but I would like to get to the
bottom of this weirdness before I do),
I am working in development mode. I can edit and test the .js.erb file in
assets with no problems for hours on end. Most of the time I don't even
have to restart the server (usually when I edit routes.rb).
Suddenly, it gives me an error message about needing to pre-compile the js
file in production mode by editing a config file and restarting.
Can you copy/paste the full error message please. I have seen errors
like this where the message is a bit confusing.
Also it would be worth comparing the logs before and after it fails to
see what the difference is.
Colin
Without
changing the config (as it recommends) when I restart the app it no longer
loads the javascript file, and none of the routines in it execute anymore.
It also ignores any edits that I make to that file. In one of the earlier
cases I did edit the config file as it requested, but that did nothing to
solve the problem.
I don't have any idea what I might have changed to cause this. I looked at
the git status and I have only changed/created four files:
1) The layout file that originally had the js code (was moved to the newly
created js.erb file)
2) The controller file
3) The routes.rb file, and
4) The newly created js.erb file.
The last edit was to correct a typo in the js.erb file.
The program works (loads the js from the layout file and does everything
that is already coded) when I switch back to the master branch, but as soon
as I go to the working branch, the problem comes back.
The rails log seems to show it loading pre-compiled scripts after it breaks,
while before it seems to be getting files from the assets directory. (Not
sure about this).
I tried both Firefox and Chrome and both show the same behavior (not
surprising).
I double checked that RAILS_ENV=development and it is. This has been setup
for years and only changes when I explicitly set it to production (rarely).
It returns to development whenever I login.
Where should I start looking for this problem?
Thanks,
Don
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/56DE5FC6.8050506%40ziesig.org.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/56DF6A26.6010805%40ziesig.org.
For more options, visit https://groups.google.com/d/optout.