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

0
votes
1answer
21 views

`rvm list remote` not showing binaries for Ubuntu 14.04 box

I'm trying to provision a dev box with rvm on Ubuntu 14.04 (via Vagrant and Ansible). I've installed rvm: gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 \curl -sSL https://get.rvm.io | ...
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 ...
0
votes
2answers
48 views

How to change installed ruby version

I am trying to run ruby on my RPi (Raspbian/Debian distro). I have installed ruby with apt-get command, but it has installed 1.9. 3 version. I wanted newer one, so I removed that one and next, ...
2
votes
2answers
48 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=( ...
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 ...
0
votes
1answer
36 views

Can we input or send any text to the daemon?

I have some ‚Äćupload/download ruby scripts; I want to run those scripts in daemon process. When I run ruby script on terminal, it ask for some input after that script start to execute. So now I want to ...
-2
votes
1answer
58 views

Ruby alternative to fabric [closed]

Is there a Ruby alternative to Python based Fabric?
0
votes
2answers
52 views

Installing Jekyll on Elementary OS using gem

When I try to install Jekyll on Elementary OS Luna with the command sudo gem install jekyll --no-rdoc --no-ri I get the following error. -- rbconfig (LoadError) from ...
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
62 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
96 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 ...
0
votes
1answer
50 views

How to create CronJob for running commands on reboot?

Via my host I have SSH access and a control panel. I installed Rails via SSH on a light weight server. I want to reboot the server when it goes down. I think I need to start it manually since I want ...
7
votes
3answers
399 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 ...
0
votes
1answer
40 views

Installing rvm and a specific version of ruby using rvm on linux based systems

UI testing is done using ruby and selenium. Installation of rvm Installation of specific version of ruby and setting a default version of ruby Note: Using a linux based operating system.
3
votes
2answers
646 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
62 views

How do I run as a limited user while logged in as Root, and another question

Is there a way to, on linux, do: run as limited user when logged in as root? (like sudo but vice versa, so instead of GRANTING rights, it limits them, i.e., for use with "bundle install" for missing ...
2
votes
0answers
602 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 ...
0
votes
2answers
121 views

Why does passing a HEREDOC as a string to `ruby -e` not work?

For reasons I don't understand, it seems to be impossible to pass a heredoc as an expression to a Ruby interpreter: $ ruby -e <<END heredoc> puts 'hi' heredoc> END ruby: no code ...
0
votes
0answers
43 views

Unable to log into Heroku: syntax error, unexpected

I'm new to Heroku. After downloading the script and installing I get an error when I try to login: $ wget -qO- https://toolbelt.heroku.com/install.sh | sh This script requires superuser access to ...
0
votes
0answers
262 views

Connection refused - connect(2)

I have set SMTP settings in both config/environments/production.rb and development.rb also i have added the settings in config/initializers/setup_mail.rb: config.action_mailer.default_url_options = { ...
0
votes
0answers
22 views

How to bring back `irb` back to teminal screen

I run a program by irb that have rescue and retry statement. Accidentally, I closed the irb running terminal. But process itself is still alive like this. ps ax | grep irb 17749 pts/0 S+ 0:00 ...
1
vote
1answer
139 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 ...
3
votes
2answers
191 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 ...
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 ...
0
votes
2answers
708 views

Installing ruby 2.1 on Arch via RVM

I have problems installing ruby 2.1.0 via RVM on Arch. My vagrant provisioning file looks like this: sudo pacman -Syu --noconfirm sudo pacman -S --needed base-devel --noconfirm sudo pacman -S vim ...
0
votes
0answers
80 views

Is there a difference between `command rspec` and `rspec`?

I want to call bundle exec rspec if Gemfile exists in current directory, and if it doesn't exists, call rspec itself. So I wrote like this. function rspec() { if [ -e 'Gemfile' ]; then echo ...
0
votes
1answer
280 views

Giving cron permission to execute command

I'm trying to get a ruby script to run via cron. The cron job looks like this: * * * * * /usr/local/rvm/rubies/ruby-2.0.0-p353/bin/ruby ...
1
vote
1answer
296 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. ...
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 ...
2
votes
0answers
158 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 ...
0
votes
1answer
627 views

Why is Ruby using 100% CPU in startup?

I installed GitLab on an EC2 instance a while ago, compiling Ruby from scratch: $ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] $ which ruby /usr/local/bin/ruby What's really ...
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 ...
0
votes
1answer
47 views

sed how to do “or”

I have the following two lines that work ok: /\.to <\=/ s/<\=/be <\=/ /\.to_not <\=/ s/<\=/be <\=/ I would like to combine them and I tried: /\.to( |_not )<\=/ s/<\=/be ...
2
votes
2answers
215 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
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 ...
3
votes
3answers
456 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 ...
-1
votes
2answers
160 views

Alternative shells (Javascript, Ruby, etc)? [duplicate]

Does anyone use a shell written in Javascript, Ruby, Clojure, etc as their everyday unix shell, instead of bash, zsh, etc? Is there any reason not to?
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
2answers
405 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
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: ...
1
vote
1answer
191 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 ...
2
votes
1answer
224 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 ...
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
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 ...
2
votes
2answers
255 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
0answers
131 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 ...
3
votes
2answers
739 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.
0
votes
1answer
53 views

Installing Ruby on Mac OS X

I had ruby installed in /usr/local/bin/ but it was outdated, so I installed newer version using brew. Now I have two installations of ruby in different dirs. Should I remove one? And how do I update ...
5
votes
3answers
733 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 ...
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 ...