Comments
-
Greg Hurrell
Starting to test this out now:
# yum install java-1.7.0-icedtea # java -version
This is enough to get a downloaded JRuby to run; I just need to decide where I am going to install it and how to set the
PATH
appropriately so that when I issue commands remotely over SSH during deployment things will just work. -
Greg Hurrell
# wget http://jruby.org.s3.amazonaws.com/downloads/1.5.2/jruby-bin-1.5.2.tar.gz # tar xzvf jruby-bin-1.5.2.tar.gz -C /usr/local # cd /usr/local # ln -s jruby-1.5.2 jruby
As for SSH and the
PATH
, the man page says it is "Set to the default PATH, as specified when compiling ssh", so I probably have to issue my commands usingenv
like this:$ ssh user@server "sh -c 'cd $DEPLOY && env PATH=/usr/local/jruby/bin:\$PATH bin/rspec -f progress spec'"
No idea if escaping the remote
$PATH
like that will work; will have to try it out. -
Greg Hurrell
Will have to keep researching:
$ ssh user@server "sh -c 'env PATH=/usr/local/jruby/bin:\$PATH echo \$PATH'" /usr/local/bin:/bin:/usr/bin
Unfortunately will have to leave it for another day though.
-
Greg Hurrell
# export PATH=/usr/local/jruby/bin:$PATH # for now # jruby -S gem update --system # jruby -S gem install bundler
-
Greg Hurrell
Just did a manual test (
bin/rspec spec
) on the server with JRuby in thePATH
and the acceptance specs (which depend on JRuby) all pass, bar one, which I'll have to investigate:1) Logging in to the site: dynamic "log in"/"log out" links (when logged out) Failure/Error: page.should have_content('log in') expected #has_content?("log in") to return true, got false # ./spec/acceptance/sessions_spec.rb:47
Surprised, actually, seeing as I didn't even have to run
bundle install
under JRuby... Although runningbundle show
does complain with:Could not find bouncy-castle-java-1.5.0145.2 in any of the sources
Ditto for
jruby -S bundle show
.(Compare that with my local machine where I get a long list for
bundle show
and the shorter JRuby platform list forjruby -S bundle show
.)Try:
$ jruby -S bundle install --quiet --deployment --local --binstubs --path /path/to/shared/bundle
And
bundle check
,jruby -S bundle check
,bundle show
, andjruby -S bundle show
all work without errors, butbundle show
(running under MRI) only shows the JRuby gems.Re-running:
$ bundle install --quiet --deployment --local --binstubs --path /path/to/shared/bundle $ bundle show
Doesn't fix the short listings.
Re-ran the acceptance specs and running
bundle install
under JRuby didn't fix that one broken spec. Will still have to investigate. -
Greg Hurrell
Ok, there are two ways of setting up the
PATH
:$ ssh user@server "sh -c 'cd /path/to/deploy/current && env PATH=/usr/local/jruby/bin:\$PATH bin/rspec -f progress spec'"
Does work.
Adding this hack to the
spec/spec_helper.rb
does also:unless ENV['PATH'].to_s =~ /jruby/ ENV['PATH'] = ['/usr/local/jruby/bin', ENV['PATH']].join(':') end
Troubleshooting that spec failure is not easy, however, as Capybara's
save_and_open_page
method doesn't work on the server (obviously it can't open, but it appears that it doesn't save either). -
Greg Hurrell
I take back what I said about
save_and_open_page
. Looks like it was changed recently to write the files toRAILS_ROOT/tmp/capybara/
. -
Greg Hurrell
Status changed:
- From: new
- To: closed
Add a comment
Comments are now closed for this issue.