We help IT Professionals succeed at work.


Ruby is an open-source dynamic object-oriented interpreted language that supports multiple programming frameworks including functional, object oriented and imperative. It also has a dynamic type system and automatic memory management. Ruby focuses on simplicity and productivity. Ruby's market share spiked due to Ruby on Rails, a model-view-controller (MVC) framework for building web applications.

I am a .net developer , trying to learn a different language or a framework, for example vue.js or ruby on rails. I have always heard that Mac OS is a great for development . what are some of the development tools that I can use or will be helpful for development in MAC OS.

if anyone wants to share their similar experience switching from windows to mac for development in a new language.
I'm learning ruby on rails , had few issues installing it in windows. I downloaded a installer for windows from railsinstaller.org/en
but ran into few issues, when i tried to create a new project with command ->  rails new my app. Error is that a Gem requires Ruby version >=2.4 .
I don't know why framework adds Gems that are dependent upon new versions of Ruby , when I downloaded an older version of ruby.

is there any good article, tutorial regarding ruby on rails development on windows ? I have heard that windows is not so good for ruby on rails development.
In ruby on rails I'm trying to render a json file that will map each comment to a review. Each Review has many comments but each comment belongs to a review.

Here is my controller to generate a json file.

`  reviews: @ship.reviews.preload(:user_profile).map do |review|
          id: review.id,
          body: review.body,
          rating: review.rating,
          user_profile: review.user_profile,
          comments: @review.comment.preload(:comment).map do |comment|
              id: comment.id,
              body: comment.body,
              user_profile: comment.user_profile_id,

Open in new window

Here is the comment model

class Comment < ApplicationRecord
  belongs_to :user_profile
  belongs_to :review

Open in new window

Here is the review.rb model

`class Review < ApplicationRecord
  belongs_to :user_profile
  belongs_to :ship
  has_many :comments
  has_many :helpfuls

Open in new window

However my json file returns an error: undefined method `comment' for nil:NilClass on this line:

comments: @review.comment.preload(:comment).map do |comment|

Open in new window

Our developers are attempting to use THIN (Open Source) on our iSeries.  It seems to be installed - but when we try to call the command we get the following:

thin: command not found

I attempted to do a:

yum install thin

But I get this:

yum install thin          
Setting up Install Process
No package thin available.
Error: Nothing to do      

This might be related to something with gemsets...but thought I would reach out to see if anyone knew what I might need to do...
Now this is IT learning day one but I am self taught so apologies. I have a nice Ruby program that backs up a directory - "G:/Sage50" in the file copied below. I need to copy other folders - eg "G:\Sage Export" so had the idea of changing the text to an array ('Source') then reusing the code with different parameters. It should be so simple but i am foxed.
Could somebody help me please, encapsulating the code into a block that can be called on many occasions, with the folders set as parameters with each run? - with exit at the very end, of course!

#!/usr/bin/env ruby

require 'fileutils'

require 'date'
require 'time'
tooday = Date.today
tomonth =Date.today.strftime('%B')
nameday = tooday.strftime('%a')
namemonth = tomonth
puts nameday
puts namemonth

Source = "G://Sage50/"
replacements = {"://" => "/"}
Sourcery = Source.gsub(Regexp.union(replacements.keys), replacements)
puts Source
lister = Dir.glob Source + "**/"

for i in lister
  sister = i.to_s.gsub(/\"/, "/").gsub(/[\[\]]/, '')
  mister = sister.slice! Source
  puts sister
  Dir.mkdir("H://"  + nameday + "/" + Sourcery + sister) unless File.exists?("H://"  + nameday + "/" + Sourcery + sister)

filer = Dir.glob(Source  + "**/*").select{ |e| File.file? e }
#puts filer
for i in filer
  tooday =  File.mtime(i)
  tonow = Time.now-9900000
  if tooday >  tonow
    siler = i.to_s.gsub(/\"/, "/").gsub(/[\[\]]/, '')
    miler = siler.slice! Source
    tiler =  "H://" +  nameday…
I am new to Ruby and VS Code.  Have installed both as per: https://medium.com/@terrenceong/ruby-development-with-vs-code-fab258db5f1d

Seems to start up OK but when I try the simple code attached I get the error as per the attached.The error I am trying to solve
From StackOverflow et al I am not the only one who has experienced this error.

Any advice will be most appreciated, and thanks in anticipation.  

This may be more a matter of taste rather than a technical question:

I have a web app that I'm going to be selling Membership access to. I'd like to use Shopify as the Merchant Account/Gateway in which I will need to purchase and configure two plugins:

1. A Recurring Subscription plug-in that will allow me to charge Customer's 30 days out from when they subscribed and keep that payment recurring for a given duration
2. An "Affiliate" plug-in as I will be paying a Sales Team a portion of the initial cost from the Customers.

I realize this is a big ask and I'm fairly new to Shopify, so please use laymen's terms with your suggestions. The app is written in Node.JS/React so I suspect that integration won't be too difficult for the Devs.

Thanks for your assistance.
I'm trying to create a table with an index named 'by_sub_account_classification_code'.
Due to long default index name i got 'index name too long' error. So I tried to name the index with 'name' option , but somehow it does not work. Do you know what is wrong with this migration code?

Any advised would be very appreciated.

Rails version: 5.2.1

$ bundle exec rails db:migrate
== 20190403020630 CreateSubAccountClassificationCodes: migrating ==============
-- create_table(:sub_account_classification_codes)
rails aborted!
StandardError: An error has occurred, all later migrations canceled:

Index name 'index_sub_account_classification_codes_on_account_classification_code_id' on table 'sub_account_classification_codes' is too long; the limit is 64 characters

Open in new window

class CreateSubAccountClassificationCodes < ActiveRecord::Migration[5.2]
  def change
    create_table :sub_account_classification_codes do |t|
      t.integer :sub_account_classification_code, null: false
      t.references :account_classification_code, foreign_key: true
      t.string :description, null: false


    # Name cannot be specified. don't know why. Fix in future.
    add_index :sub_account_classification_codes, :sub_account_classification_code, :name => 'by_sub_account_classification_code'

Open in new window

I am attempting to modify a file that is supposed to be at


I am root and cannot see this file

if i do a find i get this

[root@ugw1baspippin01 /]# find -name jenkins

Open in new window

I have an array of numbers and want to find the numbers that can add up to the max number in the array if possible.
So, my max number = 50 and the numbers that can add up to 50 are [4,5,7,10,24] … is this possible and how?
Using Windows 10 - want to connect to sql server and download some data.
Any help appreciated.

I updated the patches on a Ubuntu box running gitlab-ce.  Now it's refusing to start with the following error in unicorn_stderr.log

F, [2018-10-12T21:47:15.632756 #3235] FATAL -- : error adding listener addr=
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:185:in `bind': Cannot assign requested address - bind(2) for (Errno::EADDRNOTAVAIL)
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:185:in `new_tcp_server'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/socket_helper.rb:165:in `bind_listen'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:242:in `listen'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `block in bind_new_listeners!'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `each'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:813:in `bind_new_listeners!'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:138:in `start'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'
      from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `load'
      from …
Hi All,

I have an requirement to convert the .webarchive file into xml and vice-versa.
Can you please provide any reference links for scripts or tool which does this.

Hi All,

I have decent powershell skills, I now want to learn either Ruby or Python , which language will you recommend  and which will be the easiest for someone from a powershell background?

Also do any know if if chef configuration management support python?

thank you in advance
this script pick up a file and steps through it, and then picks up another file and matches the item number to merge the file and i getting this error, and I do not know why ?

here is the code where the file is blowing up with the following errors repeatedly.

substr outside of string at ./parseOsc.pl line 272, <PLUS> line 745800.
substr outside of string at ./parseOsc.pl line 273, <PLUS> line 745800.
Use of uninitialized value $bo_plus in substitution (s///) at ./parseOsc.pl line 283, <PLUS> line 745800.
Use of uninitialized value $res_plus in substitution (s///) at ./parseOsc.pl line 284, <PLUS> line 745800.
Use of uninitialized value $res_plus in string eq at ./parseOsc.pl line 286, <PLUS> line 745800.
Use of uninitialized value $bo_plus in string eq at ./parseOsc.pl line 287, <PLUS> line 745800.

while(<PLUS>) {
     $the_plus = $_;
     $item_plus = substr($the_plus, 0,10);
     $bo_plus   = substr($the_plus,36, 5);
     $res_plus  = substr($the_plus,41, 5);

   next if $item_plus =~ m/\s*MSC/i;
     $item_plus =~ s/\s+//;
     next if $item_plus eq "";
   #print " $item  >$item_plus< \t $bo_plus  \t $res_plus \n";
   $bo_plus  =~ s/\s+//; ### Error happens here !!!
   $res_plus =~ s/\s+//; ### Error happens here !!!

         $res_plus = ($res_plus eq "" ) ? '0' : $res_plus;
        $bo_plus = ($bo_plus eq "" ) ? '0' : $bo_plus;
        next if ( $item ne $item_plus);
I am trying to install redmine (a ruby based bug tracker) on a goDaddy VPS running ubuntu 15.10. I got the app to install on my dev box using Ubuntu 16.04, however GoDaddy does not offer that as an option for VPS.

For the most part things are working and from what I gather, to get over the 500 error I am getting now, I need to run:
sudo RAILS_ENV=production bundle exec rake db:migrate

Open in new window

And here is where things become harder than the documentation. Now when I run the command I am given the output of:
W: `require 'RMagick'` is deprecated, please change to `require 'rmagick'`

Open in new window

This is where I am over my head for Linux. I am sure this is an easy fix, but I have no idea where to look. I swear I installed Ruby 2.3.3 before I rebooted, however when I run
ruby -v

Open in new window

I get
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]

Open in new window

. When I run
sudo rails -v

Open in new window

, I get
Rails 4.1.10

Open in new window


Again, I just want to get this command to run:
sudo RAILS_ENV=production bundle exec rake db:migrate

Open in new window

, please help.
I just spun up an Ubuntu 15.1 server on GoDaddy VPS.

I am trying to get a ruby web app working, when I enter command:
 ruby -v

Open in new window

I get  back: ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]

however, in my home directory I see a folder named ruby-2.4.0. Why is my Ubuntu server not using Ruby 2.4?

this website has a very organized layout

what language
or what content management system is used

I have installed the following gem:


The documentation states the following:

Ruby on Rails
Add the autoprefixer-rails gem to your Gemfile:
gem "autoprefixer-rails"

Clear your cache:
rake tmp:clear

I found a file named 'Gemfile', at the following location:

I opened the file, which had the following line
eval_gemfile "#{ File.dirname(__FILE__) }/sprockets4.gemfile"

Open in new window

i added the line,
gem "autoprefixer-rails"

Open in new window

just underneath and saved

Is this what was needed?

About the cache instructions:

I issued the command rake tmp:clear, from the following two locations

I received the error response

rake aborted!
No Rakefile found

Open in new window

Also, there are separate instructions for Ruby on rails, and separate instructions for Ruby. What is the difference?

Thanks for your help!
Hi there, recently our business has started to request the need for remote data and or a portal page for our clients.
I have developed in ASP.net (ASP.NET Core) and I have done some research on web api and how it works.
My question is this, what is the general structure for business applications? Is there usually a back-end server program that interacts internally with the company database to process/send request such as web-api that then forwards them to an internal or externally hosted application such as a rails/asp.net site. Or are these generally lumped together into one single application hosted internally? We currently are using WCF services for an in-house mobile application so my thoughts were creating an api that we could use for any existing and future projects to use. Mainly the goal I want to achieve is a reusable system.

Thanks for any help.
# Check OS platform to ensure this only executes on Windows

include_recipe "chef_handler"

powershell_script do
  code <<-EOH
  # Title:
  # Description:
  # Returns 1 if any share or share path allow read/write by the 'Everyone' group (fail)
  # Returns 0 if this condition is not found (pass)
  # 0.1

    #get all shares
    $shares = Get-S | Select-Object Name,Path
      Foreach ($share in $shares)
        #check share for everyone permissions
        $shareAccounts = Get- -Name $share.Name
        Foreach ($account in $shareAccounts)
          If ($account.AccountName -eq 'Everyone')
            return 1

        #check underlying NTFS path for everyone permissions
        $volum= Get-$share.Path
        if ($volumePerm.Access.Where({$PS -eq 'Everyone'}))
          return 1
    return 0
    #loop through each share checking for 'Everyone'
    # How to pass the return values and send to Chef or something else.
    #build error message
#Return  some final message
   fail "instance has failed the check" if code == 1

Please respond with an example, as I think I'm looking at this the wrong way. I see it as a more complex effort - like having to write out a temp file. The client doesn't see …
I have several rows of twin radio buttons that are generated via a loop in ruby on rails.  For each row, one of the button is already selected, how do i detect if the user accidentally click on a radio button that's already selected?  Keep in mind these buttons all have generated ids so I can just look for a specific id.  Can someone show me how to do this via ruby on rails or javascript?  Thanks.
Hello I have two XML files that I need to merge into one. I am able to use Python or Ruby to accomplish this and so far I have had little to no success.

The two XML files are as follows (unfortunately due to very restrictive licensing they can not be shared):


The products XML has over 1000 nodes(if that is the right term) for each product. One of those "nodes" is UPC which is unique. The ingredients XML files has over 500k ingredients that are all individual but match to the product by UPC.

So I am trying to merge the ingredients to the products using UPC as the unique identifier. Any help on this would be greatly appreciated.
I get the following error below with the attached ruby script and text file. Please note you will need to include the text file in the command line after entering the ruby file name. I tried referring to the variable 'mystery_word' in the script as an array but get the same error. Please help. Thanks.

'hangman.rb:47:in `<main>': undefined method `each' for "<mystery word>":String (NoMethodError)'
Hello, I am trying to update a Ruby script that looks in html files downloaded from the IRS site and finds specific text in the file to extract the Year from the document.   The script works fine however there are not 2 types of documents that can be in the folder and the line in question is different in each document.  How can I add an "or" or "if" clause so the script looks for the text formatted either way and pulls out the year based on how the line of text reads.   The line currently in the file is displayed as "TAX PERIOD:    DEC. 31, 2014"  The line in the 2nd document that I need to add is displayed as "Tax Period or Periods:  December, 2014"  I would need the year "2014" extracted from each document.   I have attached screenshots of the script in color and the 2 document types.

#Open and read the downloaded file
	transcript_html_name = files_in_dir[i]
	File.open(Dir.pwd + "/Transcripts/#{transcript_html_name}", "r") do |f|
		f.each_line do |line|
			 #Search for the Tax Period date to get the year
			if line.include? "TAX PERIOD:" 
				line.gsub!(/(<[^>]*>)|\n|\t/s) {""}
				line.slice!("TAX PERIOD:")
				line.gsub!(/\w\w\w[.]\s\d\d[,]\s/) {""}
				year = line

Open in new window



Ruby is an open-source dynamic object-oriented interpreted language that supports multiple programming frameworks including functional, object oriented and imperative. It also has a dynamic type system and automatic memory management. Ruby focuses on simplicity and productivity. Ruby's market share spiked due to Ruby on Rails, a model-view-controller (MVC) framework for building web applications.

Top Experts In