-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Problem with Erubis #347
Comments
You seem to be using RVM. Did you setup Emacs to use your RVM environment? |
(rvm-activate-corresponding-ruby) in my |
The problem is with erubis itself. The latest version, version 2.7, is from 2011. In the Ruby world where stuff changes just for the sake of novelty that's a long time. If anyone stumbles upon this problem here's the diff that solved it: diff -u -L /home/expez/.rvm/gems/rbx-head\@flix/gems/erubis-2.7.0/lib/erubis/main.rb -L \#\<buffer\ main.rb\> /home/expez/.rvm/gems/rbx-head\@flix/gems/erubis-2.7.0/lib/erubis/main.rb /tmp/buffer-content-15168ngi
--- /home/expez/.rvm/gems/rbx-head@flix/gems/erubis-2.7.0/lib/erubis/main.rb
+++ #<buffer main.rb>
@@ -487,12 +487,12 @@
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
def check_syntax(filename, src)
- require 'compiler'
+ require 'rubinius/compiler'
verbose = $VERBOSE
msg = nil
begin
$VERBOSE = true
- Rubinius::Compiler.compile_string(src, filename)
+ Rubinius::ToolSet.current::TS::Compiler.compile_string(src, filename)
rescue SyntaxError => ex
ex_linenum = ex.line
linenum = 0 I also had to install the rubinius-compiler gem. I tried looking for another erb syntax checker, but couldn't find one. Does others exist, @yasuyk? I think Flycheck should have checkers that work out of the box for all the major ruby implementations (MRI, JRuby and Rubinius) |
@expez Hi, AFAIK, there is no other erb syntax checker. IMO, It is the bug of erubis, so erubis should fix it. |
By the way, why doesn't anyone send above patch to erubis? |
@expez @lunaryorn I have to go to work from now. I will participate in this discussion again after half a day. Sorry. |
@yasuyk Take all the time you need. |
Pull request with fix opened here: kwatch/erubis#3 The tests for erubis are failing when I run them on ruby 2.1.1, so I'm guessing this software is no longer maintained. |
@yasuyk I still can't get erubis to work. Should I use it through rvm, and install it as a gem dependency in my project, or as a global gem? |
@expez You use rubinius with rvm, right? I always use CRuby with rbenv, and I have never used rubinius or rvm. I will try to reproduce it with rubinius and rvm. |
@yasuyk I got it working, I was having some troubles with rvm. Thanks for your help! |
@expez I glad to hear that! |
hi @expez, how did you sort your problem out? I have a similar problem with MRI (I sometimes use rubinius too though) and I use RVM as well:
and similarly, I have tried inserting a hook for ruby mode such as:
Any advice on how you managed to resolve the problem would be greatly appreciated. |
Also, I suspect it is some kind or rvm issue, but as far as I can tell I have it correctly configured, but I definitely have more than 16 gems, does anyone have any idea how I would be able to test where this is trying to search for dependencies? |
adding these to my emacs file seems to have fixed it (as far as I can tell), so I assume I had rvm misconfigured in my emacs, thanks again for a great package.
|
Upon syntax checking a .erb file I get the following error:
It looks like Erubis is called correctly but a
require
statement during execution fails?The text was updated successfully, but these errors were encountered: