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

jruby interprets first line comment as possible shebang code #1350

Closed
betarelease opened this issue Dec 18, 2013 · 3 comments
Closed

jruby interprets first line comment as possible shebang code #1350

betarelease opened this issue Dec 18, 2013 · 3 comments

Comments

@betarelease
Copy link

Hi,
We came across this the other day. Our ruby file(incidentally in our rails/initializers) had a comment on how to use that initializer. But the comment started on the first line and read similar to

# To use this do
# ABClassName.turnOn= true
................
..........

This caused one of the jruby runtimes to fail with the message 'Cannot load ABClassName' which was clearly available and loaded already.

We were able to fix this issue by doing the following
(essentially by making the first line a non-parsable string)

# -----------------------------
# To use this do
# ABClassName.turnOn= true
................
..........

Possibly Jruby expects shebang kind of statements(#! /usr/bin/ruby) for interpretation on the first line and having anything else just confuses it.

-Hope this helps and is fixed.

Thanks
Sudhindra

@headius
Copy link
Member

headius commented Dec 19, 2013

Very strange. I cannot reproduce here using a file that starts identically to yours.

If it were interpreting that line as a shebang, I'd expect it to complain about "ABCClassName.turnOn=" rather than just "ABCClassName".

Would it be possible for you to create a demo repository that reproduces this issue? I have no clue what would cause this.

Also: please provide JRuby version, Java version, platform, etc.

@chrisseaton
Copy link
Contributor

I also can't reproduce this problem locally. @betarelease are you still experiencing the problem? Can you provide a full test case with the file, the command line, the version and platform info?

@enebo enebo added this to the Invalid or Duplicate milestone Feb 17, 2017
@enebo
Copy link
Member

enebo commented Feb 17, 2017

No feedback in a few years...marking invalid. Please re-open if you have more info...

@enebo enebo closed this as completed Feb 17, 2017
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