Skip to content

How to run module from Ruby script #535

Description

@fplazaonate

Describe the bug

Hi,
I would like to initialize Environment Modules from a ruby script.
I have tried to import the file "/usr/share/modules/init/ruby.rb".
After that, I can't call the module function because it is a reserved keyword in ruby.

To Reproduce

Steps to reproduce the behavior:

1 - Create a test.rb script with the following content

# Load the Environment Modules system into Ruby
require '/usr/share/modules/init/ruby.rb'

# Example usage: Load a module
module('load python')

2 - Execute the script

$ruby test.rb
test.rb:5: syntax error, unexpected '\n', expecting '.' or &. or :: or '['
module('load python')

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions