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

learn more… | top users | synonyms

12
votes
2answers
6k views

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

I have to use Ubuntu 10.04 at work, and cant 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 ...
7
votes
3answers
409 views

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 ...
6
votes
1answer
662 views

`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 ...
6
votes
2answers
1k views

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 ...
5
votes
3answers
737 views

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 ...
4
votes
2answers
7k views

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 ...
4
votes
3answers
996 views

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 ...
4
votes
1answer
1k views

Can I refresh my shell within a shell script?

Very new to Bash scripting... 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 ...
4
votes
2answers
721 views

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 ...
3
votes
2answers
741 views

How to install Ruby 1.9.3 on Arch?

The wiki suggests using $sudo pacman -S ruby1.9 but the package isn't there... I'd rather not compile it from source but I can if no one knows.
3
votes
4answers
5k views

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 ?
3
votes
2answers
192 views

Time running a Ruby script is different locally than over SSH

Has anyone else seen this behavior? I created a simple Ruby script for giggles to see how fast it would count up on a couple machines I have. Here's the source: for n in 1...1000000 do ...
3
votes
2answers
674 views

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 ...
3
votes
2answers
2k views

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 ...
3
votes
1answer
162 views

I shouldn't use root on my new ubuntu cloud instance, right?

I am playing with ubuntu on my new Rackspace cloud instance. However, the information they give me is for root access -- that doesn't seem like a best practice for doing development on this thing. ...
3
votes
1answer
1k views

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 ...
3
votes
3answers
459 views

Command line options of rackup are not shown in ps output or procfs

As you know if you wish to get command-line runtime arguments for running command you can parse ps -e or /proc/<pid>/cmdline. But I have encountered issue when this method returns only command ...
3
votes
2answers
411 views

Ruby update not working using two methods

I tried to install ruby version 1.9.3 with this on my mac 10.6.8: $ \curl -L https://get.rvm.io | bash -s stable --ruby Oskar-Niburskis-MacBook-Pro:~ oskarniburski$ rvm install ruby-1.9.3-p362 ...
2
votes
2answers
114 views

How can I test for a file having a value?

I am using source ~/.rvm/scripts/rvm repos="repo_1_ruby_193 repo_2_ruby_211 repo_3_ruby_191" > rvm_check.txt for repo in $repos do cd ~/zipcar/$repo 2>rvm_check.txt cd .. echo $repo if ...
2
votes
2answers
217 views

sed - remove unmatched “}”, “)” or ']" (only for the line in question)

I have a file with a lot of lines Some of the lines end in unmatched braces, i.e. "}" This is only true for lines that contain ".to" How can I remove the unmatched braces with sed for ALL lines ...
2
votes
2answers
258 views

Using RVM with gvim without installing the ruby binary

In Arch Linux, apparently gvim requires to install ruby as a dependency. However, if I want to work with RVM, then I don't need the binary ruby installed. Can that cause problems? Can ruby be ...
2
votes
2answers
50 views

How to select unique array values?

I have an array and I want to get the unique 2nd members bash doesn't really have 2-dimensional array so I've defined it this way, using :: as the separator of the two elements: ruby_versions=( ...
2
votes
1answer
2k views

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 ...
2
votes
2answers
662 views

How can I create a bash script which runs irb, then some ruby code?

I'm trying to do this to make unit testing a breeze for myself. The contents of an example script in question are as follows: irb require 'random_utils.rb' a = SuccessChecker.new Right now this ...
2
votes
1answer
1k views

Bash Commands not working on Mac

Hello I open my terminal window on Mac Os 10.6.8 as I am trying to update my ruby to 1.9.3 and the terminal gives me this response immediately as I open it: -bash: export: ...
2
votes
1answer
225 views

How to let pacman notice the ruby installed by rbenv?

I use rbenv to manage ruby versions. I want to install gvim on my ArchLinux and one of it's dependency is ruby. I'm already use rbenv to install the version 2.0.0-p247 of ruby as root ...
2
votes
0answers
605 views

Running shell script inside with vagrant provision

I have setup a vagrant box using precise64 (ubuntu 14.04) and installed packages needed for octopress. I can ssh into the vagrant box and generate posts and run preview for my octopress site. Now I ...
2
votes
0answers
160 views

FreeBSD 8.4 pkgdb fails after upgrade to Ruby 1.9

I just upgrade Ruby 1.8 to Ruby 1.9. After the upgrade I followed the instructions in the UPDATING file located in /usr/ports. I issued the following two commands: portmaster -o lang/ruby19 ...
2
votes
0answers
132 views

Ubuntu : puppet f5 device config : Partition '' doesn't exist

This is a Puppet question that I've posted on the PuppetLabs forums with no response. I'm also posting here because I'm hoping that with a wider audience I might find someone knowledgeable re Puppet ...
1
vote
1answer
192 views

How to pipe to bash as a different user

I am running an experiment as a way to solve a bigger problem. For the experiment, I need to install rvm as a user who does not have a shell. To install rvm, you use the following command \curl -L ...
1
vote
1answer
893 views

Opening a file with space from Ruby

When I need to progmatically open in emacs a file that has a space in its name, how can I do that? I've tried these commands from a Ruby script, inside backquotes or popen(…): emacs "foo bar" or ...
1
vote
1answer
4k views

How to properly automatically/manually rotate log files for production Rails App

I am taking over administration for a server which has a custom made 3rd party Rails app. The app developer informed me that the ruby log files are getting large and pointed me to the following link: ...
1
vote
3answers
5k views

packages have unmet dependencies - unable to install packages

I am trying to install passenger module with bellow command: sudo passenger-install-apache2-module And I am getting following output: * GNU C++ compiler... found at /usr/bin/g++ * Curl ...
1
vote
1answer
140 views

Can't find rbenv after installation

I've been trying to install rbenv on my fresh Debian 7.4 install, per the instructions here. I follow all the steps on the guide, and they all work fine: I can use rbenv to install Rubies and gems ...
1
vote
3answers
699 views

Providing the full path doesn't work but calling just the name of the program does, why?

What am I missing? I can call "rvm" from the command line but not reference the entire path that which rvm says I'm using. Not that it's important, but I stay logged in as "jenkins" the entire time ...
1
vote
3answers
3k views

Can't install pg gem

I cant get the pg gem to install. I have tried --with-pg_config and it didnt work. Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. ...
1
vote
1answer
161 views

How to add methods to rush (Ruby shell)?

I am starting to learn the basics of rush (ruby shell), and I know it is possible to invoke methods such as home['foobar.c'].vi. However, say I wanted to edit it with GNU Emacs, how do I add a new ...
1
vote
2answers
2k views

Check the Existence of a Network Interface Card Redhat

I'm aware that I can use ethtool eth0|eth1|eth2 to check the existence of a NIC. But I wonder where the files are on the machine that contain information of an existing interface, as I need to use ...
1
vote
1answer
20 views

How to wrap iptables commands around Ruby webrick server going up and down in a single command/script?

I would like to use this Ruby WEBrick server solution for on-demand showcasing of some random web pages. So I set up some forwarding exception on my adsl modem local web interface(192.168.2.1). Then ...
1
vote
1answer
388 views

How to get 'TZ' with out '$TZ' being set?

I writing a Ruby program. I need a way to get something like America/New_York as ActiveSupport::TimeZone and require "tzinfo" can't get my current timezone. (Note that Time.now.zone can get things ...
1
vote
1answer
412 views

Customize Emacs Ruby Mode for PuppetLabs conifguration

I predominantly use emacs for editing my Puppet configuration files. I use the following settings in my .emacs to load Ruby mode and use it for Puppet config files (*.pp): (autoload 'ruby-mode ...
1
vote
1answer
475 views

Why doesn't Ruby's configure script detect my executables and header files?

I'm trying to compile Ruby and really understanding what's going on while doing so. I've used and written Makefiles before, but not autoconf's configure.in files, so maybe the result I'm getting is by ...
1
vote
0answers
14 views

How can I syntax highlight Ruby range bounds in gtksourceview3.0?

I do most of my coding in gedit, which highlights integers and other syntax. When I use an integer range in Ruby, represented as 0..3 for example, the integers are not properly highlighted and are ...
1
vote
0answers
63 views

Curl takes JSON file as input but not the content of a JSON file

I am uploading a JSON file using curl. I give the following in the command line as: $ curl -v --header "Content-Type: application/json" -X POST \ http://site -d @test.json where test.json is ...
1
vote
1answer
97 views

calling script from perl/python/ruby and retrieving output [closed]

I inherited a tcsh "master" script that works and extracts lines from files with data with using 'zcat' piped to 'grep' and some other commands/scripts. The extracted lines contain numbers . It is ...
1
vote
1answer
81 views

How can I add autocomplete for “gem which” with rbenv?

I am using rbenv on Mac OS X. I have autocomplete functionality already for the gem command: $ gem build environment lock query stale cert fetch ...
1
vote
1answer
299 views

“Failed to build gem native extension” when installing xively-rb for raspberry Pi

I'm trying to install the xively Ruby gem on the Raspberry Pi - http://rubygems.org/gems/xively-rb However, during install the following occurs: gem install xively-rb Building native extensions. ...
1
vote
1answer
181 views

Ubuntu LTS : best practice for installing gems

Ubuntu 12.04 LTS Server I'm relatively new to Unix/Ubuntu. I need to install the ruby gem libopenssl-ruby. I know that Ubuntu LTS versions maintain lists of authorized package versions. apt-get ...
1
vote
0answers
387 views

How to install Ruby Test to Sublime Text 2

I am quite new to Ubuntu, so I am running into some problems. I was following this tutorial to install Ruby Tests for Sublime Text 2: https://github.com/maltize/sublime-text-2-ruby-tests There is ...
1
vote
0answers
107 views

Ruby on Rails missing Thor

When trying to run rails g migration a, I get the following message Thor is not available. If you ran this command from a git checkout of Rails, please make sure thor is installed, and run this ...