Questions tagged [ruby]

Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.

Ruby

Ruby is an open-source dynamic object-oriented interpreted language that combines the good bits from Perl, Smalltalk and Lisp. It supports multiple programming paradigms. Ruby's primary purpose is to "help every programmer in the world to be productive, and to enjoy programming, and to be happy." Ruby is a dynamic, open source programming language with a focus on simplicity and productivity.

Ruby mindshare spiked around 2005 due to Ruby on Rails, a popular web application framework built on Ruby.

You can download the Ruby source code from http://www.ruby-lang.org/en/downloads/ or from GitHub.

Alternative Ruby implementations

Knowledge Base

Where to start

Tools

Free Ruby Programming Books

160 questions
13
votes
2 answers

Best way to upgrade vim/gvim to 7.3 in Ubuntu 10.04?

I have to use Ubuntu 10.04 at work, and can't upgrade it. I'm using Vim/gVim 7.2. I want to upgrade it to 7.3 (with Python and Ruby extension support). Which is the best way? Add an entry in sources.lists and install a 7.3 vim/gvim package from it,…
12
votes
5 answers

Advantages (or downsides) of GVim over Vim to edit code

Should I install vim or GVim ? I develop mainly Ruby on Rails (I also use IDE's, but different topic). Are there any differences or advantage of using Gvim vs vim ?
Michael Durrant
  • 41,213
  • 69
  • 165
  • 232
10
votes
2 answers

How do you specify alternative script interpreters (shebangs)?

In an executable file, you specify the environment using a shebang: #!/usr/bin/env ruby # ruby code here But what if you want to specify multiple possible environments? For example, if you have multiple versions of Ruby installed, you may want to…
sffc
  • 231
  • 2
  • 7
10
votes
4 answers

git push fails with remote: error: hook declined to update refs/heads/master

I'm recently trying to start my own project on a community git repo, and I've been having some complications. I'm new to git, but here's what I've been trying to do to just test it. I run the following commands and they all run ok. git config…
Joshua Strot
  • 499
  • 1
  • 4
  • 16
9
votes
1 answer

How to use specify version of ruby for shell script with rbenv?

I'm going to write some short script in ruby. And I want to specify ruby version by shebang or in another way. I'll use the script in many environments. I'm using rbenv in the evironments, but it's not sure which version of ruby is installed. The…
ironsand
  • 5,085
  • 12
  • 50
  • 73
9
votes
2 answers

How to specify a higher ruby version for installing a gem?

I install a ruby package. $ sudo gem install pdfbeads ERROR: Error installing pdfbeads: nokogiri requires Ruby version >= 1.9.2. says that it needs ruby version greater than 1.9.1. My ruby is 1.8.7. $ which ruby /usr/bin/ruby $ ruby…
Tim
  • 98,580
  • 191
  • 570
  • 977
9
votes
2 answers

Making ruby available to all users

I intend to use Ruby when programming my Raspberry Pi which is running the Debian based Occidentals. Via SSH, I executed: curl -L https://get.rvm.io | bash -s stable --ruby which downloaded the ruby source and compiled it. It tool about 2 hours to…
barry
  • 205
  • 1
  • 2
  • 7
7
votes
2 answers

TinyCore Linux & RVM

I'm running TinyCore Linux and when I tried to install RVM (needed a portable linux distro for QA Automation) I keep getting an error sh: syntax error:unexpected redirection. I am unsure why I am getting this error since the echo $SHELL command…
JustAl
  • 139
  • 1
  • 4
7
votes
3 answers

How to configure Ruby to use the correct gemset or Ruby version on a per-project basis?

I open a terminal and navigate to my project folder (ex: cd /proj/tickecting_app). After this I execute this command: rvm use ruby 1.9.x@gemset . I want this command to run this every time I open the terminal. Is there a way to run this…
Sridhar
  • 73
  • 4
6
votes
3 answers

Small Linux distro with Ruby

I have been using Puppy Linux for basic Linux needs, however now I would prefer one that has Ruby included, so that it does not have to be downloaded. I would prefer a small distro that can run from a CD, smaller size preferred to decrease boot…
Zombo
  • 1
  • 5
  • 43
  • 62
6
votes
1 answer

`kill -s TERM` works, `kill -s ABRT` gets "Operation not permitted"

There is a process that I own whose documentation claims I can send SIGABRT to in order to get some debugging information. However, when I try to send SIGABRT, I get back "Operation not permitted". I have also tried sending the same signals to other…
wfaulk
  • 209
  • 2
  • 8
6
votes
3 answers

What's the best way to determine the working directory for UNIX process using 'ps'?

I am running a Ruby command line script (rufus.sh)which ultimately calls Thread.new, which spawns a UNIX process as shown below. I run this script for more than 1 directory as the output of the ps command shows below. The last (right most) column…
Chirag Patel
  • 253
  • 1
  • 3
  • 6
5
votes
1 answer

Crontab + Ruby on Rails: /usr/bin/env: ruby: No such file or directory

I have a ruby on rails app and I need to schedule a crontab for a rake task. */5 * * * * RAILS_ENV=production /usr/local/bin/rake -f /usr/local/www/mysite-web-production/current/Rakefile my_site:export_products >> /var/log/export_feed.log…
bigpotato
  • 275
  • 1
  • 3
  • 10
5
votes
1 answer

Can I refresh my shell within a shell script?

I am trying to setup a script that starts with a minimal CentOS 6 install and provisions it for Ruby development. #!/bin/bash # Add PostgreSQL Repo rpm -i http://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/pgdg-redhat91-9.1-5.noarch.rpm # Add…
CT.
  • 413
  • 1
  • 5
  • 6
5
votes
1 answer

Fastest way to determine if directory contents have changed since last time

I have a script that checks a directory using mdls* (to sort by added time) and them performs some operations. However, mdls is a bit slow so I’d like to run it only when absolutely necessary (i.e. when directory contents have changed). My idea is…
user137369
  • 477
  • 2
  • 4
  • 13
1
2 3
10 11