How do I run ruby commands in my bash script without getting “ruby: command not found”



my script=


#!/bin/bash
echo ************************BEGIN LOG******************************>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
date +"%m/%d/%Y %H:%M:%S $HOSTNAME">>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
ruby /root/backup_scripts/new_scripts/aapxen01.rb>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
ruby /root/backup_scripts/new_scripts/apvdbs03.rb>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
ruby /root/backup_scripts/new_scripts/aapxen02.rb>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
echo end log entry>

Related to : How do I run ruby commands in my bash script without getting “ruby: command not found”
linux like behavior in windows shell - running ruby without “ruby” appended to the command?
Programming Languages

This is probably a really silly question bu tI can't seem to find an answer since I'm apparently failing on keywords.


You know how you can run commands from the commandline in linux if you put a line on the top of your .rb file so you don't have to type ruby myfile.rb all the time and can just do ./myfile.rb ? Is it possible to have the same thing on a windows environment? I use git bash as my shell most of the time and have a lot of cygwin binaries installed. It's just that the general method is to put that line on top and then chmod the file, which isn't really an option.


How do I run ruby commands in my bash script without getting “ruby: command not found”
Programming Languages

my script=


#!/bin/bash
echo ************************BEGIN LOG******************************>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
date +"%m/%d/%Y %H:%M:%S $HOSTNAME">>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
ruby /root/backup_scripts/new_scripts/aapxen01.rb>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
ruby /root/backup_scripts/new_scripts/apvdbs03.rb>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
ruby /root/backup_scripts/new_scripts/aapxen02.rb>>/root/backup_scripts/new_scripts/vmbackup.log 2>&1
echo end log entry>
RUBY ON RAILS - “msvcrt-ruby18.dll was not found” with Ruby
Programming Languages

i am using:
windows 7
rails 3.0


whenever i try to run rake db:migrate. i get the following error in popup...


This application has failed to start because msvcrt-ruby18.dll was not found. Re-installing the application may fix the problem.


need help here..
thnx..


Ruby Gems returns “command not found”
Programming Languages

Ubuntu 9.10


Just installed newgem


gem install newgem

and when i try


newgem new_project

I get


adam@adam-ubuntu:~$ newgem newproject
newgem: command not found

Ive checked my path via echo $PATH


adam@adam-ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/adam/.gem

and my gem enviroment


adam@adam-ubuntu:~$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3
The “:w ! ruby” vim command is failed to run the ruby script with “require_relative”
Programming Languages

Here is my ruby script:


require_relative 'lib/say.rb'
say("hello")

I run it from macvim via :w ! ruby and got:


:w ! ruby
-:1:in `require_relative': cannot infer basepath (LoadError)
from -:1:in `<main>'
shell returned 1

Though ! ruby % vim command works fine.
And also changing the require_relative... to require File.expand_path('../lib/say', __FILE__) also helps...


But... What is actually wrong with these friends: require_relative + :w ! ruby

When you run “rails server” how do you get the ruby version to match what you see with “ruby -v”?
Programming Languages

I can't seem to get my version of ruby when running "rails server" to be the same as the one in terminal. If I run commands like ruby -v I get 1.9.3 which is the version that I want to use. But I get 1.8.7 when I use rails server. Any idea how I get get my local server to leverage 1.9.3? I am using a Mac with Lion.


CHRISs-MacBook-Pro:test_app chrisrothstein$ rvm list
rvm rubies
=* ruby-1.9.3-p125 [ x86_64 ]
# => - current
# =* - current && default
# * - default
CHRISs-MacBook-Pro:test_app chrisrothstein$ ruby -v
ruby 1.9.3p125 (2012-02-16 rev

HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .