I'm trying to use Opal to convert ruby code to javascript. At first, it looked pretty promising, but it just doesn't work with my class. I get the below error which does not make sense to me:
SyntaxError: An error occurred while compiling: (file)
unexpected '"kEND"'
Source: (file):1:7718
Here is the gist link to the ruby file I'm trying to convert to javascript: query_builder.rb
This compiles in my ruby interpreter just fine. I'm not sure if opal is using an incompatible version of ruby or what the deal is. But my code is pretty standard ruby. Any help would be greatly appreciated. Thank you in advance.
-
hmmm. Could you send me the shortlink to that? It still doesn't work for me.Horse Voice– Horse Voice2015年10月05日 19:39:10 +00:00Commented Oct 5, 2015 at 19:39
-
I tried this on a friends chrome browser as well. That doesnt work either.Horse Voice– Horse Voice2015年10月05日 19:45:55 +00:00Commented Oct 5, 2015 at 19:45
-
Sorry, it seems I was wrong. Going to delete my comment.cremno– cremno2015年10月05日 19:49:21 +00:00Commented Oct 5, 2015 at 19:49
-
Aww man I got excited for a sec. Thanks anyway.Horse Voice– Horse Voice2015年10月05日 19:58:14 +00:00Commented Oct 5, 2015 at 19:58
-
1Found the issue. This time I'm sure!cremno– cremno2015年10月05日 20:04:42 +00:00Commented Oct 5, 2015 at 20:04
1 Answer 1
The linked code uses hard tabs instead of the usual two spaces for indententation. According to this GitHub issue tabs seem to be an issue for Opal. So replace them with your favorite text editor and it'll compile.