aris
December 7, 2012, 5:03pm
1
The Problem
Running:
jruby --ng-server &
then
jruby --ng -S rspec spec/models
gives:
Errno::ENOENT: No such file or directory -
/Users/johngallagher/Documents/Code/AC-Video/classpath:bin/rspec
What I want
To run rspec with jruby 1.7.1 from a nailgun server.
My setup
rvm with jruby 1.7.1 installed
ruby 1.9.3
bundler
gems:
actionmailer (3.2.9)
actionpack (3.2.9)
active_attr (0.6.0)
activemodel (3.2.9)
activerecord (3.2.9)
activerecord-jdbc-adapter (1.2.2.1)
activerecord-jdbcmysql-adapter (1.2.2.1)
activeresource (3.2.9)
activesupport (3.2.9)
arel (3.0.2)
bcrypt-ruby (3.0.1 java)
blankslate (2.1.2.4)
bouncy-castle-java (1.5.0146.1)
builder (3.0.4)
bundler (1.2.3)
capistrano (2.13.5)
clj (0.0.5.6)
coderay (1.0.8)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0)
configatron (2.9.1)
database_cleaner (0.9.1)
devise (2.1.2)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.4.0)
factory_girl (4.1.0)
ffi (1.1.5 java)
ffi-locale (1.0.1)
ffi-ncurses (0.4.0)
highline (1.6.15)
hike (1.2.1)
i18n (0.6.1)
jdbc-mysql (5.1.13)
journey (1.0.4)
jquery-rails (2.1.3)
jruby-launcher (1.0.15 java)
jruby-openssl (0.8.1, 0.7.7)
json (1.7.5 java)
mail (2.4.4)
method_source (0.8.1)
mime-types (1.19)
multi_json (1.3.7)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.6.1)
net-ssh-gateway (1.1.0)
newrelic_rpm (3.5.2.17)
orm_adapter (0.4.0)
polyglot (0.3.3)
pry (0.9.10 java)
pry-rails (0.2.2)
psych (1.3.4)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.9)
railties (3.2.9)
rake (10.0.2, 0.9.4)
rdoc (3.12)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
rspec-mocks (2.11.3)
rspec-rails (2.11.4)
rubygems-bundler (1.1.0)
rvm (1.11.3.5)
rvm-capistrano (1.2.7)
sass (3.2.3)
sass-rails (3.2.5)
shoulda-matchers (1.4.1)
simple_form (2.0.4)
slop (3.3.3)
spoon (0.0.1)
spork (1.0.0rc3)
spork-rails (3.2.0)
sprockets (2.2.1)
therubyrhino (2.0.1)
therubyrhino_jar (1.7.4)
thor (0.16.0)
tilt (1.3.3)
torquebox (2.1.2)
torquebox-cache (2.1.2 java)
torquebox-capistrano-support (2.1.2)
torquebox-configure (2.1.2 java)
torquebox-core (2.1.2 java)
torquebox-messaging (2.1.2 java)
torquebox-naming (2.1.2 java)
torquebox-rake-support (2.1.2)
torquebox-security (2.1.2 java)
torquebox-server (2.1.2 java)
torquebox-stomp (2.1.2)
torquebox-transactions (2.1.2)
torquebox-web (2.1.2 java)
treetop (1.4.12)
tzinfo (0.3.35)
uglifier (1.3.0)
warden (1.2.1)
wistia-api (0.1.6)
yamler (0.1.0)
I did do
bundle --binstubs
which might have something to do with it.
John -
If you’re using rvm, I’d suggest not using the ‘jruby’ and ‘jruby -S’
forms, and just using the plain ‘ruby’, ‘rspec’, etc. notations.
I don’t know that this is the cause of the problem, and what you did
looks to me like it should work, but it’s possible.
To simplify the use of Nailgun, I have a set of scripts that can easily
be created in one command, in my blog article about Nailgun at
http://www.bbs-software.com/blog/2012/09/15/hello-nailgun-goodbye-jvm-startup-delays/ .
Also, I’m not sure, but I’m wondering if your path might be mangled.
Here’s a command that will list each directory in the path on its own
line:
echo $PATH | tr : \n
Keith R. Bennett
John -
You’re very welcome
I don’t know about the Psych/Yecht issue. It’s confusingmy understand
is that both are separate YAML parsers, so it sounds like some kind of
configuration mixup.
I did find these message threads that might provide clues for you:
opened 01:23AM - 31 Aug 11 UTC
closed 07:30PM - 13 Sep 11 UTC
I've been trying to start up a project using jruby-1.6.3 but Padrino seems to be… the kind of hard arse hitman that doesn't like Java
```
mongrelion@squives ➜ code rvm jruby@padrino
mongrelion@squives ➜ code padrino --version
Padrino v. 0.10.1
mongrelion@squives ➜ code padrino g project jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
mongrelion@squives ➜ code jruby -S padrino g jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
mongrelion@squives ➜ code padrino generate project jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
mongrelion@squives ➜ code jruby -S padrino generate jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
mongrelion@squives ➜ code rvm jruby@padrino09
mongrelion@squives ➜ code padrino --version
Padrino v. 0.9.29
mongrelion@squives ➜ code padrino g project jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
mongrelion@squives ➜ code jruby -S padrino g jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
mongrelion@squives ➜ code padrino generate project jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
mongrelion@squives ➜ code jruby -S padrino generate jrack-test
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
```
opened 03:46PM - 05 Jan 12 UTC
closed 09:56PM - 19 Jan 12 UTC
In order for DJ to run on JRuby, [yaml_ext.rb](https://github.com/collectiveidea… /delayed_job/blob/master/lib/delayed/yaml_ext.rb) needs to detect the Yecht parser, which is compatible with Syck. Currently it doesn't match the regular expression on line 5, falls through to the Psych extensions, and fails with the following error:
```
undefined method `visit_Psych_Nodes_Mapping' for class `Psych::Visitors::ToRuby'
org/jruby/RubyModule.java:2221:in `alias_method'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/activesupport-3.1.3/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/delayed_job-3.0.0/lib/delayed/psych_ext.rb:64:in `ToRuby'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/delayed_job-3.0.0/lib/delayed/psych_ext.rb:32:in `Visitors'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/delayed_job-3.0.0/lib/delayed/psych_ext.rb:23:in `Psych'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/delayed_job-3.0.0/lib/delayed/psych_ext.rb:22:in `(root)'
org/jruby/RubyKernel.java:1038:in `require'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/delayed_job-3.0.0/lib/delayed/psych_ext.rb:9:in `(root)'
org/jruby/RubyKernel.java:1038:in `require'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/delayed_job-3.0.0/lib/delayed/yaml_ext.rb:11:in `(root)'
org/jruby/RubyKernel.java:1038:in `require'
/Users/cpence/.rvm/gems/jruby-1.6.5/gems/delayed_job-3.0.0/lib/delayed_job.rb:68:in `require'
org/jruby/RubyArray.java:1612:in `each'
...
```
Sorry that I don't have time to prepare a pull request. `YAML.parser.class.name` on JRuby returns `YAML::Yecht::Parser`.
Best of luck,
Keith
Keith
Running ‘ruby’ solved my issue. Thanks for the help! Much appreciated.
I love your blog post and aliases - very handy.
The only barrier to getting everything working now is my
‘uninitialized constant Psych::Yecht’
error - NameError: uninitialized constant Psych::Yecht with jruby 1.7.1 - JRuby - Ruby-Forum
Do you have any ideas on how to solve that?
John