-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
So Rails Rake Tasks Don't work? Preview 1 - 9.0.0.0 #2497
Comments
Wow, that's surprising. We do test Rails periodically and did so again immediately before the release on multiple platforms. This seems like something missed in the parser. I'll try to reproduce. Is this the entire, exact contents of |
The task as given appears to parse successfully in JRuby. There's something else at play here, perhaps with how activesupport is loading the file? |
Can you run this same command but with |
We run Rails + Rake we before we release so we are at least loading enough to run a database migration. I sometimes see misreported lines in backtraces when a subfile fails and Rails also uses Autoload which could possibly fire off a load which is failing? |
@headius The entire contents of the rake file is: desc "Create an Api Key assuming one doesn't exist."
task :create_api_key, [:name] => :enviroment do | t, args |
if !ApiKey.find_by_application_name(args[:name])
if ApiKey.new(name: args[:name], api_key: SecureRandom.hex(32)).save!
puts "Your key is: " + ApiKey.find_by_application_name(args[:name]).api_key
else
puts "Could not create the api key, you might be missing an argument: Application Name."
end
else
puts "This application already contains an api key."
end
end
desc "Finds a key based on application name."
task :find_api_key, [:name] => :enviroment do | t, args |
if ApiKey.find_by_application_name(args[:name])
puts ApiKey.find_by_application_name(args[:name]).api_key
else
puts "There is no application key with that name."
end
end
desc "Get all API Keys."
task :all_keys do
ApiKey.all.each do | key |
puts "Application Name: " + key.application_name
puts "Application Key: " + key.api_key
puts "-----------------------------------------"
end
end
desc "Delete an Api Key."
task :delete_key, [:name] => :enviroment do | t, args |
if ApiKey.find_by_application_name(args[:name])
if ApiKey.find_by_application_name(args[:name]).destroy!
puts "Key Destroyed."
else
puts "Something went wrong with deleting the key. We found it, we just can't delete it oO."
end
else
puts "No key was found by that application name."
end
end I haven't been able to test every other rake task, so there might be issues aside from jruby issues. But the one I have tested is the The model for these tasks: class ApiKey < ActiveRecord::Base
validates :application_name, presence: true, uniqueness: true
end There is no controller. People in stack are stating that Running the command you asked, with the additional params: Adams-Mac-mini:BlackBird Adam$ JRUBY_OPTS="-Xbacktrace.style=raw -Xjit.threshold=0" bin/rake create_api_key aisis_platform --trace
rake aborted!
SyntaxError: /Users/Adam/Documents/Rails-Projects/BlackBird/lib/tasks/create_api_key.rake:5: syntax error, unexpected tCONSTANT
java/lang/Thread.java:1588:in `getStackTrace'
org/jruby/runtime/backtrace/TraceType.java:175:in `getBacktraceData'
org/jruby/runtime/backtrace/TraceType.java:39:in `getBacktrace'
org/jruby/RubyException.java:227:in `prepareBacktrace'
org/jruby/exceptions/RaiseException.java:215:in `preRaise'
org/jruby/exceptions/RaiseException.java:194:in `preRaise'
org/jruby/exceptions/RaiseException.java:110:in `<init>'
org/jruby/Ruby.java:3978:in `newRaiseException'
org/jruby/Ruby.java:3757:in `newSyntaxError'
org/jruby/parser/Parser.java:135:in `parse'
org/jruby/parser/Parser.java:89:in `parse'
org/jruby/Ruby.java:2691:in `parseFileAndGetAST'
org/jruby/Ruby.java:2650:in `parseFile'
org/jruby/Ruby.java:2637:in `parseFile'
org/jruby/Ruby.java:2860:in `loadFile'
org/jruby/runtime/load/LibrarySearcher.java:249:in `loadScript'
org/jruby/runtime/load/LibrarySearcher.java:237:in `load'
org/jruby/runtime/load/LibrarySearcher.java:35:in `load'
org/jruby/runtime/load/LoadService.java:326:in `load'
org/jruby/RubyKernel.java:977:in `loadCommon'
org/jruby/RubyKernel.java:969:in `load19'
org/jruby/ir/runtime/IRRuntimeHelpers.java:871:in `unresolvedSuper'
org/jruby/ir/instructions/ZSuperInstr.java:40:in `interpret'
org/jruby/ir/interpreter/Interpreter.java:324:in `processCall'
org/jruby/ir/interpreter/Interpreter.java:551:in `interpret'
org/jruby/ir/interpreter/Interpreter.java:639:in `INTERPRET_BLOCK'
org/jruby/runtime/InterpretedIRBlockBody.java:74:in `commonYieldPath'
org/jruby/runtime/IRBlockBody.java:84:in `yieldSpecific'
org/jruby/runtime/Block.java:116:in `yieldSpecific'
org/jruby/ir/runtime/IRRuntimeHelpers.java:450:in `yieldSpecific'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/activesupport_minus_4_dot_2_dot_0/lib/active_support//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:106:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:115:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:272:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:78:in `callBlock'
org/jruby/runtime/callsite/CachingCallSite.java:82:in `call'
org/jruby/ir/instructions/CallBase.java:388:in `interpret'
org/jruby/ir/interpreter/Interpreter.java:320:in `processCall'
org/jruby/ir/interpreter/Interpreter.java:551:in `interpret'
org/jruby/ir/interpreter/Interpreter.java:654:in `INTERPRET_METHOD'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:147:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:206:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:312:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:162:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/engine.rb:658:in `run_tasks_blocks_CLOSURE_1__run_tasks_blocks_0'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/railties_minus_4_dot_2_dot_0/lib/rails//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/engine.rb:658:in `run_tasks_blocks_CLOSURE_1__run_tasks_blocks_0'
org/jruby/runtime/CompiledIRBlockBody.java:66:in `commonYieldPath'
org/jruby/runtime/IRBlockBody.java:145:in `doYield'
org/jruby/runtime/BlockBody.java:82:in `yield'
org/jruby/runtime/Block.java:147:in `yield'
org/jruby/RubyArray.java:1569:in `each'
org/jruby/runtime/callsite/CachingCallSite.java:138:in `callBlock'
org/jruby/runtime/callsite/CachingCallSite.java:144:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/engine.rb:658:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/railties_minus_4_dot_2_dot_0/lib/rails//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/engine.rb:658:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:106:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:115:in `call'
org/jruby/ir/runtime/IRRuntimeHelpers.java:833:in `instanceSuper'
org/jruby/ir/runtime/IRRuntimeHelpers.java:826:in `instanceSuperSplatArgs'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/application.rb:438:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/railties_minus_4_dot_2_dot_0/lib/rails//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/application.rb:438:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:138:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:145:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:206:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:312:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:162:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/engine.rb:453:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/railties_minus_4_dot_2_dot_0/lib/rails//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/railties-4.2.0/lib/rails/engine.rb:453:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:106:in `call'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:118:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:130:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:198:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:292:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:130:in `call'
org/jruby/ir/interpreter/Interpreter.java:308:in `processCall'
org/jruby/ir/interpreter/Interpreter.java:551:in `interpret'
org/jruby/ir/interpreter/Interpreter.java:619:in `INTERPRET_ROOT'
org/jruby/ir/interpreter/Interpreter.java:100:in `execute'
org/jruby/ir/interpreter/Interpreter.java:28:in `execute'
org/jruby/ir/IRTranslator.java:39:in `execute'
org/jruby/Ruby.java:844:in `runInterpreter'
org/jruby/Ruby.java:2867:in `loadFile'
org/jruby/runtime/load/LibrarySearcher.java:249:in `loadScript'
org/jruby/runtime/load/LibrarySearcher.java:237:in `load'
org/jruby/runtime/load/LibrarySearcher.java:35:in `load'
org/jruby/runtime/load/LoadService.java:326:in `load'
org/jruby/RubyKernel.java:977:in `loadCommon'
org/jruby/RubyKernel.java:969:in `load19'
org/jruby/internal/runtime/methods/DynamicMethod.java:210:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:206:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:312:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:162:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:138:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:145:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:206:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:312:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:162:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:690:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:690:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:122:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:130:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:198:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:292:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:130:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:94:in `load_rakefile_CLOSURE_1__load_rakefile_1'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:94:in `load_rakefile_CLOSURE_1__load_rakefile_1'
org/jruby/runtime/CompiledIRBlockBody.java:66:in `commonYieldPath'
org/jruby/runtime/IRBlockBody.java:84:in `yieldSpecific'
org/jruby/runtime/Block.java:116:in `yieldSpecific'
org/jruby/ir/runtime/IRRuntimeHelpers.java:450:in `yieldSpecific'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:122:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:130:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:302:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:140:in `callBlock'
org/jruby/runtime/callsite/CachingCallSite.java:144:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:93:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:93:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:122:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:130:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:198:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:292:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:130:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:77:in `run_CLOSURE_1__run_1'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:77:in `run_CLOSURE_1__run_1'
org/jruby/runtime/CompiledIRBlockBody.java:66:in `commonYieldPath'
org/jruby/runtime/IRBlockBody.java:84:in `yieldSpecific'
org/jruby/runtime/Block.java:116:in `yieldSpecific'
org/jruby/ir/runtime/IRRuntimeHelpers.java:450:in `yieldSpecific'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:122:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:130:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:302:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:140:in `callBlock'
org/jruby/runtime/callsite/CachingCallSite.java:144:in `call'
/Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in `__script__'
Users/Adam/Documents/Rails_minus_Projects/BlackBird/$_dot_bundle/gems/gems/rake_minus_10_dot_4_dot_2/lib/rake//Users/Adam/Documents/Rails-Projects/BlackBird/.bundle/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in `__script__'
org/jruby/internal/runtime/methods/CompiledIRMethod.java:122:in `call'
org/jruby/internal/runtime/methods/InterpretedIRMethod.java:130:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:198:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:292:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:130:in `call'
org/jruby/ir/interpreter/Interpreter.java:308:in `processCall'
org/jruby/ir/interpreter/Interpreter.java:551:in `interpret'
org/jruby/ir/interpreter/Interpreter.java:619:in `INTERPRET_ROOT'
org/jruby/ir/interpreter/Interpreter.java:100:in `execute'
org/jruby/ir/interpreter/Interpreter.java:28:in `execute'
org/jruby/ir/IRTranslator.java:39:in `execute'
org/jruby/Ruby.java:844:in `runInterpreter'
org/jruby/Ruby.java:2867:in `loadFile'
org/jruby/runtime/load/LibrarySearcher.java:249:in `loadScript'
org/jruby/runtime/load/LibrarySearcher.java:237:in `load'
org/jruby/runtime/load/LibrarySearcher.java:35:in `load'
org/jruby/runtime/load/LoadService.java:326:in `load'
org/jruby/RubyKernel.java:977:in `loadCommon'
org/jruby/RubyKernel.java:969:in `load19'
org/jruby/internal/runtime/methods/DynamicMethod.java:210:in `call'
org/jruby/internal/runtime/methods/DynamicMethod.java:206:in `call'
org/jruby/runtime/callsite/CachingCallSite.java:312:in `cacheAndCall'
org/jruby/runtime/callsite/CachingCallSite.java:162:in `call'
bin/rake:16:in `__script__'
bin/bin/rake:16:in `__script__'
java/lang/invoke/MethodHandle.java:599:in `invokeWithArguments'
org/jruby/ir/Compiler.java:112:in `load'
org/jruby/Ruby.java:817:in `runScript'
org/jruby/Ruby.java:810:in `runScript'
org/jruby/Ruby.java:761:in `runNormally'
org/jruby/Ruby.java:569:in `runFromMain'
org/jruby/Main.java:405:in `doRunFromMain'
org/jruby/Main.java:300:in `internalRun'
org/jruby/Main.java:227:in `run'
org/jruby/Main.java:199:in `main' My conclusion from this is that Because Java has a SecureRandom class and Ruby has the same class that they are conflicting? Do you guys run the rails test suite? I also upgrade rails regularly, so if a new update comes out I usually upgrade, Security or other wise. |
After comparing with some of my rails friends, to make sure I wasn't on drugs it does seem to be a parser error. |
I cannot see the issue this is in our tracker but I fixed this bug 2-3 weeks ago with a ton of other mixed hash + {} and [] sorts of bugs. @AdamKyle If I really did not fix this then re-open but I would bet some cash I did... |
So I might be on drugs, but I hope not. So I have a Rails 4.2 project with Jruby 9.0.0.0.-pre1 installed and being used by the project.
I then have the following task:
Running:
bin/rake create_api_key aisis_platform
Gives me:Now what makes me think this is a bug is because I posted the issue here on stack Thinking I didnt know basic ruby. But the one comment there states that there is no errors.
So .....
Am I on something or does jruby just fail? or do we not support rails?
The text was updated successfully, but these errors were encountered: