Mathew
Mathew

Reputation: 231

Creating a simple ruby project

Creating a ruby project

I am trying to create a simple ruby project to use the rubygem and ruby-jmeter, but unsure on how to proceed further. Below is the github of project. https://github.com/flood-io/ruby-jmeter

//Below is my test.rb

require 'rubygems'
require 'ruby-jmeter'

test do
  threads count: 10 do
    visit name: 'Google Search', url: 'http://google.com'
  end
end.jmx

How can i creating a ruby project with needed gems, Its not a rails application.... a simple ruby project.

Upvotes: -1

Views: 1290

Answers (2)

mikdiet
mikdiet

Reputation: 10038

You can use bundler for this. Read "Getting Started" on http://bundler.io

In brief:

  1. Create Gemfile with required gems
  2. Run bundle install
  3. Require rubygems, bundler/setup and all needed gems in your app.

Upvotes: 1

Stefan Dorunga
Stefan Dorunga

Reputation: 679

Well the way I would do it is first create a folder for your project and then run:

bundle init

Edit the Gemfile that was just created and make it look like this

# A sample Gemfile
source "https://rubygems.org"

gem "ruby-jmeter"

After this you run

bundle install

From now on you can run your ruby app with a bundle exec and it loads all the gems from your Gemfile. In addition to this if you provide a path like bundle exec --path vendor/bundle it will install the gems locally to the project so you keep the dependencies independent of your global ruby installation.

Upvotes: 2

Related Questions