尝试使用nailgun和spork使我的rspec 1.2测试在JRuby和Rails 2.3.10上更快地运行时出错
我最近开始在Rails 2.3 Web应用程序中使用JRuby。从那以后,我在rspec测试中一直感觉很慢...自从改用JRuby以来,该测试花费的时间太长。
在使用MRI时,我从不费心使用spork来更快地运行测试,但是现在我需要加快测试的执行速度。
首先,我尝试了spork,但由于以下原因未能解决:
spork 0.9 RC支持jruby,但不支持rails 2.3
(仅支持滑轨3)
spork 0.8支持rails 2.3,但不支持jruby,我认为它使用fork(),spork-0.8 gem不会发生
在jruby上安装)。
我试图在jruby,rails 2.3和spork 0.9 rc上运行测试,但没有成功,实际上有一条警告消息说spork 0.9 rc仅支持rails> = 3.0
然后,我尝试使用nailgun,在我的jruby环境中安装了nailgun gem(gem安装nailgun),并启动了nailgun服务器(在我的应用程序的根目录中是ruby --ng-server)。
然后,我运行我的一种规格(ruby --ng -S规格spec / lib / importacao_atividades_spec.rb)。我第一次执行该规范时,它就很好了,但是在那之后,它不断提高RuntimeError:无效的运行时
检查跟踪:
RuntimeError: invalid runtime
require at org/jruby/RubyKernel.java:1038
require at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:184
(root) at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/mysql-2.8.1/lib/mysql.rb:3
require at org/jruby/RubyKernel.java:1038
require at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/mysql-2.8.1/lib/mysql.rb:68
each at org/jruby/RubyArray.java:1602
require at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66
each at org/jruby/RubyArray.java:1602
require at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55
require at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/bundler-1.0.12/lib/bundler.rb:120
load_gems at /Users/razenha/Projects/Pro/portaltrademarketing/config/boot.rb:116
process at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/rails-2.3.10/lib/initializer.rb:164
send at org/jruby/RubyKernel.java:2052
run at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/rails-2.3.10/lib/initializer.rb:113
(root) at /Users/razenha/Projects/Pro/portaltrademarketing/config/environment.rb:12
require at org/jruby/RubyKernel.java:1038
require at /Users/razenha/.rvm/rubies/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
(root) at /Users/razenha/Projects/Pro/portaltrademarketing/config/environment.rb:47
require at org/jruby/RubyKernel.java:1038
require at /Users/razenha/.rvm/rubies/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
(root) at /Users/razenha/Projects/Pro/portaltrademarketing/spec/spec_helper.rb:1
load at org/jruby/RubyKernel.java:1063
load_files at ./spec/lib/importacao_atividades_spec.rb:15
each at org/jruby/RubyArray.java:1602
load_files at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:14
run_examples at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/rspec-1.2.9/lib/spec/runner/options.rb:132
run at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/rspec-1.2.9/lib/spec/runner/command_line.rb:9
(root) at /Users/razenha/.rvm/gems/jruby-1.6.1/gems/rspec-1.2.9/bin/spec:5
load at org/jruby/RubyKernel.java:1063
(root) at /Users/razenha/.rvm/gems/jruby-1.6.1/bin/spec:19
所以我真的被困在这里。有人知道我该如何解决射钉枪的问题?如果没有,还有其他选择吗?是否可以在jruby和Rails 2.3中使用spork?
没有找到相关结果
已邀请:
1 个回复
岭取