1

I'm on OSX 10.8 and i'm trying to execute a script from my home directory, ~.

The script is to shorten the creation of a new rails app, e.g:

ruby new path/to/app

This is the alias in my ~/.profile:

alias rc="~/.rubynew

And the contents of .rubynew, which have been run through chmod 755 ~/.rubynew are:

#!/bin/bash

$path="~/Documents/Rails_Apps/"

ruby new $path+=$1

Further Information

Executed as:

rc helloworld

Should create an application with the path:

~/Documents/Rails_Apps/hellworld

I'm getting errors for these, which I use to compile c with gcc, in exactly the same method. I have Googled this for a good one hour and rewritten in 50 different ways and it refuses to work, any guesses?

~/Documents/Rails_Apps does exist.

Errors:

/Users/tsujp/.rubynew: line 3: =~/Documents/Rails_Apps/: No such file or directory
ruby: No such file or directory -- new (LoadError)
2
  • It's rails new ..., not ruby new ... Commented Aug 12, 2013 at 12:09
  • Ah, well fixing that still yields no result. It defaults back to the home directory. Commented Aug 12, 2013 at 12:21

1 Answer 1

1

Solved.

First of all, I had ruby new instead of rails new

Secondly I didn't need to concatenate the lines in the script, this yields:

#!/bin/bash

rails new "~/Documents/Rails_Apps/"$1

It now works as intended.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.