Skip to content

Instantly share code, notes, and snippets.

@mjc
Created July 18, 2013 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjc/6029781 to your computer and use it in GitHub Desktop.
Save mjc/6029781 to your computer and use it in GitHub Desktop.
rbx error differences
class Moo
def self.moo
a = 50a
end
end
# require './moo.rb' in pry
# rbx:
# SyntaxError: /usr/local/rvm/rubies/rbx-head/runtime/melbourne.rbc:81: expecting keyword_end
# from /usr/local/rvm/rubies/rbx-head/runtime/melbourne.rbc:81:in `syntax_error'
# MRI 2.0.0p247
# SyntaxError: /var/www/apps/movingdirectory/current/moo.rb:3: syntax error, unexpected tIDENTIFIER, expecting keyword_end
# from (pry):1:in `require'
@mjc
Copy link
Author

mjc commented Jul 18, 2013

# irb
# rbx:
# rubinius-2.0.0.n199 :001 > require './moo.rb'
# SyntaxError: expecting keyword_end
#   from /usr/local/rvm/rubies/rbx-head/runtime/melbourne.rbc:81:in `syntax_error'
#   from /usr/local/rvm/rubies/rbx-head/runtime/melbourne.rbc:97:in `parse_file'
#   from /usr/local/rvm/rubies/rbx-head/runtime/compiler/stages.rbc:225:in `par#se'
#   from /usr/local/rvm/rubies/rbx-head/runtime/compiler/stages.rbc:207:in `run'
#   from /usr/local/rvm/rubies/rbx-head/runtime/compiler/compiler.rbc:375:in `run'
#   from /usr/local/rvm/rubies/rbx-head/runtime/compiler/compiler.rbc:91:in `compile'
#   from kernel/delta/codeloader.rb:182:in `compile_file'
#   from kernel/delta/codeloader.rb:156:in `load_file'
#   from kernel/common/codeloader.rb:130:in `require'
#   from kernel/common/codeloader.rb:226:in `require'
#   from kernel/common/kernel.rb:639:in `gem_original_require (require)'
#   from /usr/local/rvm/rubies/rbx-head/lib/rubygems/core_ext/kernel_require.rb:51:in `require'
#   from (irb):1
#   from kernel/common/block_environment.rb:55:in `call_on_instance'
#   from kernel/common/eval.rb:74:in `eval'
#   from kernel/common/kernel19.rb:42:in `loop'
#   from kernel/bootstrap/proc.rb:22:in `call'
#   from kernel/common/throw_catch19.rb:8:in `catch'
#   from kernel/common/throw_catch.rb:10:in `register'
#   from kernel/common/throw_catch19.rb:7:in `catch'
#   from kernel/bootstrap/proc.rb:22:in `call'
#   from kernel/common/throw_catch19.rb:8:in `catch'
#   from kernel/common/throw_catch.rb:10:in `register'
#   from kernel/common/throw_catch19.rb:7:in `catch'
#   from kernel/delta/codeloader.rb:68:in `load_script'
#   from kernel/delta/codeloader.rb:119:in `load_script'
#   from kernel/loader.rb:649:in `script'
#   from kernel/loader.rb:850:in `main'rubinius-2.0.0.n199 :002 > 

# MRI 2.0.0p247
#2.0.0p247 :001 > require './moo.rb'
# SyntaxError: /var/www/apps/movingdirectory/current/moo.rb:3: syntax error, unexpected tIDENTIFIER, expecting keyword_end
#   from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
#   from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
#   from (irb):1
#   from /usr/local/rvm/rubies/ruby-2.0.0-p247/bin/irb:13:in `<main>'

@brixen
Copy link

brixen commented Jul 18, 2013

sasha:rubinius brian$ rbx syntax_error.rb
A syntax error has occurred:
    expecting keyword_end
    near line /source/rubinius/rubinius/syntax_error.rb:3, column 11

Code:
    a = 50a
          ^

Backtrace:
  Rubinius::Melbourne(Rubinius::Melbourne19)#syntax_error at staging/runtime/melbourne.rbc:81
  Rubinius::Melbourne(Rubinius::Melbourne19)#parse_file at staging/runtime/melbourne.rbc:97
           Rubinius::Compiler::FileParser#parse at staging/runtime/compiler/stages.rbc:225
 Rubinius::Compiler::Parser(Rubinius::Compiler::FileParser)#run at staging/runtime/compiler
                                                                   /stages.rbc:207
                         Rubinius::Compiler#run at staging/runtime/compiler/compiler.rbc:375
                     Rubinius::Compiler.compile at staging/runtime/compiler/compiler.rbc:91
              Rubinius::CodeLoader#compile_file at kernel/delta/codeloader.rb:182
                 Rubinius::CodeLoader#load_file at kernel/delta/codeloader.rb:156
               Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:64
               Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:119
                        Rubinius::Loader#script at kernel/loader.rb:649
                          Rubinius::Loader#main at kernel/loader.rb:850
sasha:rubinius brian$ ruby -v syntax_error.rb
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
syntax_error.rb:3: syntax error, unexpected tIDENTIFIER, expecting keyword_end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment