I am trying to run ctioga2 and I keep getting the same error:
bash-4.1$ ctioga2
/usr/bin/ctioga2:49:in `require': /usr/lib/ruby/site_ruby/1.8/ctioga2/plotmaker.rb:646: syntax error, unexpected ')' (SyntaxError)
) do |plotmaker, size, options|
^
/usr/lib/ruby/site_ruby/1.8/ctioga2/plotmaker.rb:646: syntax error, unexpected '|', expecting '='
/usr/lib/ruby/site_ruby/1.8/ctioga2/plotmaker.rb:867: syntax error, unexpected kEND, expecting $end
from /usr/bin/ctioga2:49
Do you guys know why this happens?
Not familiar with the code base exactly of tioga2. Based on the error message it was expecting an assignment (=) and ran into a | and )
This is a ruby-1.8 specific bug. It is now fixed in the git repository (commit: be1cc4b).
But stackoverflow is not the place to file bug reports for programs, you're lucky I stumbled upon this one.
For ctioga2, please use either the bug tracker at sourceforge: https://sourceforge.net/p/ctioga2/tickets/ or the one at github if you prefer: https://github.com/fourmond/ctioga2/issues/.
Related
in OSX install error,
brew install coreutils
Error: coreutils: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:73: syntax error, unexpected << def caveats; <<~EOS
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:77: syntax error, unexpected tIDENTIFIER, expecting keyword_end
can add a "gnubin" directory to your PATH from your bashrc like:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:77: syntax error, unexpected ':', expecting keyword_end
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:79: dynamic constant assignment
PATH="#{opt_libexec}/gnubin:$PATH"
^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:81: dynamic constant assignment
Additionally, you can access their man pag...
^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:81: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
Additionally, you can access their man pages with ...
^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:82: syntax error, unexpected tIDENTIFIER, expecting keyword_end
the "gnuman" directory to your MANPATH from your bashrc as well:
^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:82: syntax error, unexpected ':', expecting keyword_end
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:84: dynamic constant assignment
MANPATH="#{opt_libexec}/gnuman:$MANPATH"`
What is the reason?
Please help me thanks
There is a closed issue on GitHub about this: https://github.com/Homebrew/brew/issues/3353
According to that discussion, this resolves the error:
rm -rf /usr/local/Homebrew/.git
brew update
brew config
I have not tested this myself.
Parse error: syntax error, unexpected 'Sns_Avaz_Model_Observer'
(T_STRING) in
/home/ganyobiclothing/public_html/app/code/local/Sns/Avaz/Model/Observer.php
on line 1
If this is the sns-avaz-responsive-magento-theme you should check the following page: http://themeforest.net/item/sns-avaz-responsive-magento-theme/11951628/comments
Hi,
This issue only happen with some hosting/server – it compress content file
We’ve fixed this issue on v1.0.1. Please try go to file: >/app/code/local/Sns/Avaz/Model/Observer.php open it and add space after re-save.
Ex: "<?php" ==> "<?php "
P/S: See my screenshot: http://take.ms/v8G03 and If your issue still … please
Thanks!
Source: http://themeforest.net/item/sns-avaz-responsive-magento-theme/11951628/comments
Good luck!
Parse error: syntax error, unexpected 'Sns_Avaz_Model_Observer' (T_STRING) in /home/ganyobiclothing/public_html/app/code/local/Sns/Avaz/Model/Observer.php on line 1
As its saying on line 1 so probably there is some white space or special character thats resulting in this.
I'm super new to rails and coding,
I have my seed.rb file and the first line is
Food.create! ( name: "Avocado")
When I try to rake db:seed, I get this error:
SyntaxError: /Users/meganryll/Desktop/foodninja/db/seeds.rb:8: syntax error, unexpected tLABEL, expecting ')'
Food.create! ( name: "Avocado")
Could anyone tell me what is wrong with that syntax?
Thanks
Ruby does not like spaces between the method name and the argument parentheses.
Food.create!( name: "Avocado")
syntax error, unexpected $end, expecting keyword_end
We’ve all been there! Assuming enough code changed that a quick glance at git diff or the like doesn’t make it obvious, is there an easy way to find that missing end (short of switching to an indentation-based language like Python)?
FWIW, I use Sublime Text 2 as my editor.
If you're using Ruby 1.9, try the -w flag when running your ruby program.
# t.rb
class Example
def meth1
if Time.now.hours > 12
puts "Afternoon"
end
def meth2
# ...
end
end
ruby t.rb
=> t.rb:10: syntax error, unexpected $end, expecting keyword_end
ruby -w t.rb
=> t.rb:5: warning: mismatched indentations at 'end' with 'if' at 3
t.rb:9: warning: mismatched indentations at 'end' with 'def' at 2
t.rb:10: syntax error, unexpected $end, expecting keyword_end
Source:
http://pragdave.blogs.pragprog.com/pragdave/2008/12/ruby-19-can-check-your-indentation.html
Edit (2023): this is now part of Ruby 3.2 and doesn‘t need to be required separately!
————————————
Edit (2022): the gem is now called syntax_suggest and is part of the Ruby standard library!
————————————
Since December 2020, there is also the dead_end gem which helps you detect missing ends.
The easiest way to get started is to install the gem:
gem install dead_end
and run it directly from your console, providing the file name to scan:
dead_end myfile.rb
This will provide you with a more helpful error message:
43 if (col_idx - 1) % 3 == 0
50 if !contains?(doc, node)
❯ 51 doc.add_child(node)
❯ 52 tree.
53 end
54 end
See the documentation for more options.
If you're using rails, you can run the problematic file specifically with the -w flag.
If you still can't find the offending mismatch, then my go-to way of solving this problem is just commenting out chunks of code until I can isolate the problematic area.
On OS X you can use command + / to comment out the highlighted piece of text.
I just installed Ruby 1.9.2 after having used 1.8.7, as there is a feature I need. I had called many of my methods like this:
do_something (arg0, arg1)
With 1.9.2, i get the following error, syntax error, unexpected ',', expecting ')' and the fix seems to be:
do_something arg0, arg1
But this could take me hours to fix all the cases. Is there a way around this? Why is it an error in the first place? thanks
The extra space is the culprit. Use:
do_something(arg0, arg1)