Setting up EDI Fails with Ruby version > 1.8

Bug #1342227 reported by Jason Stephenson
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned
2.7
Fix Released
Undecided
Unassigned
2.8
Fix Released
Undecided
Unassigned

Bug Description

Trying to run the install.sh script for EDI on Ubuntu 14.04 fails to properly install everything.

First, you have to install ruby-dev and subversion if you have not got them already. (NOTE: You will need ruby-dev, though it won't actually help at this point. You will have more errors with just ruby.)

When you do run install.sh, you will get the output below:

opensrf@jasondev:/openils/var/edi$ sudo ./install.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package rubygems is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  ruby

E: Package 'rubygems' has no installation candidate
Successfully installed rubygems-update-2.3.0
1 gem installed
Installing ri documentation for rubygems-update-2.3.0...
Installing RDoc documentation for rubygems-update-2.3.0...
/openils/var/edi/rubygems /openils/var/edi
A trunk/History.txt
A trunk/test
A trunk/test/test_kernel.rb
A trunk/test/test_gem_commands_uninstall_command.rb
A trunk/test/test_gem_spec_fetcher.rb
A trunk/test/test_gem_dependency_installer.rb
A trunk/test/test_gem_uninstaller.rb
A trunk/test/test_gem_commands_generate_index_command.rb
A trunk/test/test_gem_gem_path_searcher.rb
A trunk/test/test_gem_gem_runner.rb
A trunk/test/test_gem_commands_lock_command.rb
A trunk/test/test_gem_ext_configure_builder.rb
A trunk/test/test_gem_command_manager.rb
A trunk/test/test_gem_dependency_list.rb
A trunk/test/test_gem_package_tar_header.rb
A trunk/test/functional.rb
A trunk/test/test_gem_commands_contents_command.rb
A trunk/test/test_gem_version_option.rb
A trunk/test/test_gem_commands_build_command.rb
A trunk/test/insure_session.rb
A trunk/test/test_gem_commands_environment_command.rb
A trunk/test/test_gem_package_tar_reader.rb
A trunk/test/rubygems_plugin.rb
A trunk/test/test_gem_builder.rb
A trunk/test/test_gem_commands_stale_command.rb
A trunk/test/gem_installer_test_case.rb
A trunk/test/test_gem_stream_ui.rb
A trunk/test/test_gem_gemcutter_utilities.rb
A trunk/test/foo
A trunk/test/foo/discover.rb
A trunk/test/test_gem_remote_fetcher.rb
A trunk/test/bogussources.rb
A trunk/test/test_gem_package_tar_writer.rb
A trunk/test/test_gem_commands_sources_command.rb
A trunk/test/test_gem_package_tar_reader_entry.rb
A trunk/test/rubygems
A trunk/test/rubygems/commands
A trunk/test/rubygems/commands/crash_command.rb
A trunk/test/test_gem_config_file.rb
A trunk/test/private_key.pem
A trunk/test/test_gem_commands_pristine_command.rb
A trunk/test/test_gem.rb
A trunk/test/test_gem_commands_which_command.rb
A trunk/test/public_cert.pem
A trunk/test/test_gem_commands_query_command.rb
A trunk/test/test_gem_commands_install_command.rb
A trunk/test/test_gem_format.rb
A trunk/test/test_gem_commands_list_command.rb
A trunk/test/test_gem_ext_ext_conf_builder.rb
A trunk/test/test_gem_commands_check_command.rb
A trunk/test/gem_package_tar_test_case.rb
A trunk/test/test_gem_installer.rb
A trunk/test/test_gem_commands_push_command.rb
A trunk/test/test_gem_commands_specification_command.rb
A trunk/test/test_gem_requirement.rb
A trunk/test/plugin
A trunk/test/plugin/load
A trunk/test/plugin/load/rubygems_plugin.rb
A trunk/test/plugin/standarderror
A trunk/test/plugin/standarderror/rubygems_plugin.rb
A trunk/test/plugin/exception
A trunk/test/plugin/exception/rubygems_plugin.rb
A trunk/test/test_gem_ext_rake_builder.rb
A trunk/test/test_gem_package_task.rb
A trunk/test/test_config.rb
A trunk/test/gemutilities.rb
A trunk/test/test_gem_command.rb
A trunk/test/data
A trunk/test/data/gem-public_cert.pem
A trunk/test/data/gem-private_key.pem
A trunk/test/test_gem_package_tar_input.rb
A trunk/test/test_gem_package_tar_output.rb
A trunk/test/fake_certlib
A trunk/test/fake_certlib/openssl.rb
A trunk/test/test_gem_platform.rb
A trunk/test/test_gem_validator.rb
A trunk/test/test_gem_commands_server_command.rb
A trunk/test/test_gem_source_index.rb
A trunk/test/test_gem_commands_outdated_command.rb
A trunk/test/test_gem_commands_mirror_command.rb
A trunk/test/mockgemui.rb
A trunk/test/simple_gem.rb
A trunk/test/test_gem_commands_dependency_command.rb
A trunk/test/test_gem_indexer.rb
A trunk/test/test_gem_doc_manager.rb
A trunk/test/test_gem_commands_unpack_command.rb
A trunk/test/test_gem_commands_update_command.rb
A trunk/test/test_gem_server.rb
A trunk/test/test_gem_commands_fetch_command.rb
A trunk/test/test_gem_commands_owner_command.rb
A trunk/test/test_gem_commands_cert_command.rb
A trunk/test/test_gem_dependency.rb
A trunk/test/test_gem_local_remote_options.rb
A trunk/test/test_gem_specification.rb
A trunk/test/test_gem_install_update_options.rb
A trunk/test/test_gem_version.rb
A trunk/cruise_config.rb
A trunk/Rakefile
A trunk/Manifest.txt
A trunk/.autotest
A trunk/ChangeLog
A trunk/.document
A trunk/README
A trunk/GPL.txt
A trunk/LICENSE.txt
A trunk/setup.rb
A trunk/pkgs
A trunk/pkgs/sources
A trunk/pkgs/sources/sources.gemspec
A trunk/pkgs/sources/lib
A trunk/pkgs/sources/lib/sources.rb
A trunk/lib
A trunk/lib/rubygems.rb
A trunk/lib/gauntlet_rubygems.rb
A trunk/lib/rbconfig
A trunk/lib/rbconfig/datadir.rb
A trunk/lib/rubygems
A trunk/lib/rubygems/user_interaction.rb
A trunk/lib/rubygems/command.rb
A trunk/lib/rubygems/dependency.rb
A trunk/lib/rubygems/source_info_cache_entry.rb
A trunk/lib/rubygems/local_remote_options.rb
A trunk/lib/rubygems/install_update_options.rb
A trunk/lib/rubygems/validator.rb
A trunk/lib/rubygems/old_format.rb
A trunk/lib/rubygems/builder.rb
A trunk/lib/rubygems/format.rb
A trunk/lib/rubygems/gemcutter_utilities.rb
A trunk/lib/rubygems/spec_fetcher.rb
A trunk/lib/rubygems/dependency_installer.rb
A trunk/lib/rubygems/indexer.rb
A trunk/lib/rubygems/ext
A trunk/lib/rubygems/ext/builder.rb
A trunk/lib/rubygems/ext/configure_builder.rb
A trunk/lib/rubygems/ext/rake_builder.rb
A trunk/lib/rubygems/ext/ext_conf_builder.rb
A trunk/lib/rubygems/doc_manager.rb
A trunk/lib/rubygems/gem_runner.rb
A trunk/lib/rubygems/config_file.rb
A trunk/lib/rubygems/custom_require.rb
A trunk/lib/rubygems/errors.rb
A trunk/lib/rubygems/version_option.rb
A trunk/lib/rubygems/package_task.rb
A trunk/lib/rubygems/specification.rb
A trunk/lib/rubygems/exceptions.rb
A trunk/lib/rubygems/require_paths_builder.rb
A trunk/lib/rubygems/text.rb
A trunk/lib/rubygems/platform.rb
A trunk/lib/rubygems/version.rb
A trunk/lib/rubygems/source_index.rb
A trunk/lib/rubygems/package
A trunk/lib/rubygems/package/tar_header.rb
A trunk/lib/rubygems/package/f_sync_dir.rb
A trunk/lib/rubygems/package/tar_writer.rb
A trunk/lib/rubygems/package/tar_input.rb
A trunk/lib/rubygems/package/tar_output.rb
A trunk/lib/rubygems/package/tar_reader
A trunk/lib/rubygems/package/tar_reader/entry.rb
A trunk/lib/rubygems/package/tar_reader.rb
A trunk/lib/rubygems/package.rb
A trunk/lib/rubygems/remote_fetcher.rb
A trunk/lib/rubygems/installer.rb
A trunk/lib/rubygems/source_info_cache.rb
A trunk/lib/rubygems/commands
A trunk/lib/rubygems/commands/push_command.rb
A trunk/lib/rubygems/commands/specification_command.rb
A trunk/lib/rubygems/commands/unpack_command.rb
A trunk/lib/rubygems/commands/generate_index_command.rb
A trunk/lib/rubygems/commands/update_command.rb
A trunk/lib/rubygems/commands/sources_command.rb
A trunk/lib/rubygems/commands/rdoc_command.rb
A trunk/lib/rubygems/commands/cleanup_command.rb
A trunk/lib/rubygems/commands/help_command.rb
A trunk/lib/rubygems/commands/lock_command.rb
A trunk/lib/rubygems/commands/fetch_command.rb
A trunk/lib/rubygems/commands/owner_command.rb
A trunk/lib/rubygems/commands/pristine_command.rb
A trunk/lib/rubygems/commands/cert_command.rb
A trunk/lib/rubygems/commands/contents_command.rb
A trunk/lib/rubygems/commands/build_command.rb
A trunk/lib/rubygems/commands/setup_command.rb
A trunk/lib/rubygems/commands/which_command.rb
A trunk/lib/rubygems/commands/environment_command.rb
A trunk/lib/rubygems/commands/query_command.rb
A trunk/lib/rubygems/commands/search_command.rb
A trunk/lib/rubygems/commands/install_command.rb
A trunk/lib/rubygems/commands/server_command.rb
A trunk/lib/rubygems/commands/stale_command.rb
A trunk/lib/rubygems/commands/outdated_command.rb
A trunk/lib/rubygems/commands/uninstall_command.rb
A trunk/lib/rubygems/commands/mirror_command.rb
A trunk/lib/rubygems/commands/list_command.rb
A trunk/lib/rubygems/commands/check_command.rb
A trunk/lib/rubygems/commands/dependency_command.rb
A trunk/lib/rubygems/requirement.rb
A trunk/lib/rubygems/gem_path_searcher.rb
A trunk/lib/rubygems/ext.rb
A trunk/lib/rubygems/uninstaller.rb
A trunk/lib/rubygems/server.rb
A trunk/lib/rubygems/defaults.rb
A trunk/lib/rubygems/security.rb
A trunk/lib/rubygems/command_manager.rb
A trunk/lib/rubygems/dependency_list.rb
A trunk/lib/rubygems/test_utilities.rb
A trunk/lib/rubygems/gem_openssl.rb
A trunk/lib/ubygems.rb
A trunk/hide_lib_for_update
A trunk/hide_lib_for_update/note.txt
A trunk/bin
A trunk/bin/update_rubygems
A trunk/bin/gem
A trunk/util
A trunk/util/CL2notes
A trunk/util/gem_prelude.rb
 U trunk
Checked out revision 2528.
/usr/lib/ruby/1.9.1/rubygems.rb:206:in `try_activate': undefined method `find_by_path' for Gem::Specification:Class (NoMethodError)
 from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
 from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
 from /openils/var/edi/rubygems/trunk/lib/rubygems/config_file.rb:50:in `<class:ConfigFile>'
 from /openils/var/edi/rubygems/trunk/lib/rubygems/config_file.rb:28:in `<top (required)>'
 from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /openils/var/edi/rubygems/trunk/lib/rubygems/gem_runner.rb:8:in `<top (required)>'
 from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from setup.rb:25:in `<main>'
sudo: update_rubygems: command not found
/openils/var/edi
Successfully installed parseconfig-1.0.4
Successfully installed rspec-3.0.0
Successfully installed edi4r-0.9.4.1
Successfully installed edi4r-tdid-0.8.1
Building native extensions. This could take a while...
Successfully installed json-1.8.1
Building native extensions. This could take a while...
ERROR: Error installing rcov:
 ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
**** Ruby 1.9 is not supported. Please switch to simplecov ****

Gem files will remain installed in /var/lib/gems/1.9.1/gems/rcov-1.0.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/rcov-1.0.0/ext/rcovrt/gem_make.out
Successfully installed openils-mapper-0.9.9
6 gems installed
Installing ri documentation for parseconfig-1.0.4...
Installing ri documentation for rspec-3.0.0...
Installing ri documentation for edi4r-0.9.4.1...
Installing ri documentation for edi4r-tdid-0.8.1...
Installing ri documentation for json-1.8.1...
Installing ri documentation for openils-mapper-0.9.9...
Installing RDoc documentation for parseconfig-1.0.4...
Installing RDoc documentation for rspec-3.0.0...
Installing RDoc documentation for edi4r-0.9.4.1...
Installing RDoc documentation for edi4r-tdid-0.8.1...
Installing RDoc documentation for json-1.8.1...
Installing RDoc documentation for openils-mapper-0.9.9...

I don't do ruby, so I have no simple fix for this. I can try banging away at it, but hopefully someone who knows more about ruby will get this working.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

It looks like this will affect Debian Jessie also, as I can only find ruby 2.1 available there. I have not tested it to make sure. Someone else will need to confirm.

summary: - Setting up EDI Fails on Ubuntu 14.04 Trusty Tahr
+ Setting up EDI Fails with Ruby version > 1.8
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Thought that maybe adding this PPA, https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng?field.series_filter=trusty, would help, but it only has packages for ruby 2.1 for trusty.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

For the Ubuntu users, adding this PPA might work: https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng-experimental?field.series_filter=trusty . I'll give it a whirl and see what happens.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Here is what I did to get a successful EDI installation. I have no idea if the software actually works at this point:

1. sudo apt-get install software-properties-common
2. sudo apt-add-repository ppa:brightbox/ruby-ng-experimental
3. sudo apt-get update
4. sudo apt-get install subversion ruby1.8 rubygems1.8
5. cp -r Open-ILS/src/edi_translator /openils/var/edi
6. cd /openils/var
7. sudo ./install.sh

On 7., you will be prompted to install ruby1.9.1, when that comes up, type the letter n and hit enter. You do not want to install ruby 1.9.1.

You will also note that update_gems fails after doing all the subversion stuff. I don't know at this point if that is important or not.

Revision history for this message
Bill Erickson (berick) wrote :

And... now it's happening on Debian Wheezy.

Building native extensions. This could take a while...
ERROR: Error installing rcov:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 -r ./siteconf20140924-13637-1eqqz5.rb extconf.rb
**** Ruby 1.9 is not supported. Please switch to simplecov ****

extconf failed, exit code 1

Revision history for this message
Mike Rylander (mrylander) wrote :

On wheezy, you can install the ruby bits by first installing ruby18-full by hand, and then /not/ letting the install.sh script install ruby-full (which is actually ruby 1.9.1). If you're already tainted by ruby 1.9.1, you'll need to purge that, and then use update-alternatives to force use or ruby1.8 /and/ gem1.8 both. I had to go as far even as finding and `rm -rf`ing every directory that belonged to ruby 1.9.1.

Revision history for this message
Chris Sharp (chrissharp123) wrote :

Here's my possible solution:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/csharp/lp1342227_edi_ruby_installation_ubuntu_trusty

Basically, I don't install the deprecated rcov gem. I am able to get webrick.bash up and running, but I don't have the means for further real-life testing in my current environment.

Also, for Ubuntu 14.04, this alleviates the need for further documentation for the added GIR segments (re: bug 1297967).

Hopefully the code addressing bug 1373690 will be in place soon and we don't have to worry about the ruby bits anymore.

Revision history for this message
Bill Erickson (berick) wrote :

Chris, I was able to get things running with your script.

I pushed a test script to the tip of user/berick/lp1342227_trusty_edi_install. Basically, put the contents of acq.edi_message.jedi for and already-translated ORDERS message into a text file, run the script on it, the output should match the value found in acq.edi_message.edi (minus timestamp differences).

Results look good so far. Will report back here after production testing.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I tried the above test script on Ubuntu 14.04 with a couple of different jedi messages and I get the following:

opensrf@jasondev:~$ Evergreen/Open-ILS/src/support-scripts/test-scripts/edi_translator.pl jedi
$VAR1 = bless( {
                 'faultString' => bless( do{\(my $o = 'Uncaught exception undefined method `each\' for nil:NilClass in method json2edi')}, 'RPC::XML::string' ),
                 'faultCode' => bless( do{\(my $o = '2')}, 'RPC::XML::i4' )
               }, 'RPC::XML::fault' );

Looks like this isn't working for me.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I used the following to extract the data for the test:

psql -t --no-align -o jedi -c "select jedi from acq.edi_message where id = 1630"

Changed the id a few times of course.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Should add I did add Chris's branch and run his installation script. This was on a virgin VM, i.e. that had not had edi setup before.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

After some help from Bill Erickson in IRC, i.e. figuring out that I needed to run only ORDERS through the test and that newlines needed to be stripped from the JEDI, it is working for me.

If you want to pull jedi from the database to test, something like the following works:

psql -t --no-align -c "select jedi from acq.edi_message where id = ?" | tr -d '\n' > jedi_file

Replace ? with the id of an ORDERS message from the table.

Changed in evergreen:
milestone: 2.next → 2.9-alpha
tags: added: pullrequest
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Fixed it up to a single commit and pushed to master, rel_2_8 and rel_2_7.

Thanks, Chris!

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
milestone: 2.9-alpha → 2.9-beta
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.