mongrel_rails start command not found - ruby-on-rails

On my server I am unable to run mongrel_rails start. I looked in /usr/bin/ and could not locate the mongrel_rails file. Instead I found it in /var/lib/gems/1.8/bin. The file includes #!/usr/bin/ruby1.8, but I am still not getting this to work.

Why not create a symlink:
ln -s /var/lib/gems/1.8/bin/mongrel_rails /usr/bin/mongrel_rails
Or even better, add /var/lib/gems/1.8/bin to your PATH.

Related

-bash: cd: supbot-tut: No such file or directory

I opened terminal fresh and typed.
$ python3
Then I typed quit to get out of it.
$ quit()
I then typed:
$ pip3 install splinter requests bs4
After I typed:
$ cd supbot-tut
-bash: cd: supbot-tut: No such file or directory
When I typed that I got the error code: -bash: cd: supbot-tut: No such file or directory.
I tried this dozens of times and it won't work. I do not know how to fix this problem and I am a new coder so please send exact code I have to write to fix this problem. Thank you!
Check if you're in the correct directory using pwd and see if that directory contains supbot-tut that you're trying to get into with ls.
Or you can make a directory using mkdir supbot-tut then you will be able to cd into it.
That error occurs when you try to issue the cd command and you pass a directory (a folder) that doesn't exist. Can you type the command ls and see if you see that directory listed. You can easily check with your file explorer too. Create that directory and your issue should go away.

Trying to create symlink - keep getting error: "File exists"

I am trying to use Pow and create a symlink so that I can ultimately run my rails application locally at the following URL:
http://market_place_api.dev/
I am going through the API's on Rails tutorial, and when I follow the author's instructions on setting up Pow and a symlink, here is what is happening:
cd into a folder called "code", and created a new rails app: $ rails new market_place_api -T
Installed Pow: $ curl get.pow.cx | sh
Gone to the Pow directory: $ cd ~/.pow
And here is where the problem occurs. The instructions say to symlink: $ ln -s /path/to/myapp
In my case, the app is located at this URL: /Users/harrylevine/Dropbox/Coding/BLOC/code/market_place_api
So I enter into the command line: $ ln -s /Users/harrylevine/Dropbox/Coding/BLOC/code/market_place_api and I keep getting this error: ln: ./market_place_api: File exists
I have tried many variations of this, including:
applying this format: ln -s target_path link_path
All to no avail.
How can I properly create this symlink so that I can ultimately run my rails application locally at the following URL:
http://market_place_api.dev/
Thank you.
The error means that there is already a file (or a sym-link) called market_place_api in that directory (~/.pow).
Check with $ ls -l to see what the file is. If it's the correct sym-link then you are ready to proceed with the tutorial.

rubys> cd command not working in command line

I'm just getting into ruby and am trying to execute a walkthrough from Sam Ruby's Agile web development.
I've created a directory using mkdir work
Next i'm instructed to open a terminal and type rubys> cd work
The error I'm getting reads:
No command 'rubys' found, did you mean:
Command 'ruby' from package 'ruby' (main)
rubys: command not found
Can anyone inform me of what I'm doing wrong?
I've also tried changing from ~ to the work directory before entering my command.
In this book, rubys> is a command prompt, much like you have C:\> in the Windows terminal.
Ignore that first bit and everything should start working.
I guess you're doing it wrong.
mkdir work
creates a directory called "work". It has nothing to do with Ruby.
cd work
will then change into that directory. Forget about the rubys>.

Having trouble running "mate .rspec"

I'm trying to run mate .rspec in my command prompt in order to open the .rspec configuration file. However, I get the error -bash: mate: command not found. Any ideas?
Though Brandon's answer is correct, there's a far simpler way to set up the mate command through TextMate itself.
In the menu bar, select Help > Terminal Usage..., choose /usr/bin from the dropdown, and it will create the link for you.
You might have to open a new Terminal window for it to take effect, but then you should be all set.
[Update]
T.J.'s answer is much better than mine. :)
[Original Answer]
TextMate installs the mate command to /usr/local/bin/mate. First, I would check to see if the mate command is in that directory:
ls -lah /usr/local/bin/mate
If you get ls: /usr/local/bin/mate: No such file or directory, then you can install the mate command by creating a symbolic link to the binary, which lives in the TextMate.app folder:
sudo ln -s /Applications/TextMate.app/Contents/Resources/mate /usr/local/bin/mate
At this point, you should be able to run mate from the command line.
If you got output other than No such file or directory from the ls command, it means that /usr/local/bin is not on your path.

Symlinking problem

Hey dudes.i am having this problem while symlinking. I have successfully deployed a ruby on rails application on server and all the migrations are done. It is deployed with phusion passenger. The application is in /home/username/rails_apps/myapp. I want to symlink it to a subdomain in my site. the path to subdomain is /home/username/public_html/subdom. So i used this command to symlink it.
ln -s '/home/username/rails_apps/myapp/public/' '/home/username/public_html/subdom'
when it is done, it creates http://subdom.maxsy.net/public
but it is supposed to be accessible by http://subdom.maxsy.net/
anybody have a sensible explanation for this problem? thanks
If /home/username/public_html/subdom already exists as a directory, the symlink does not replace the directory: instead, you get /home/username/public_html/subdom/public as a symlink pointing to /home/username/rails_app/myapp.
Since it appears that you really do want to replace /home/username/public_html/subdom by the symlink, you must first remove the /home/username/public_html/subdom directory before running ln -s /home/username/rails_app/myapp /home/username/public_html/subdom.
I think you just have one extra /, and possibly an existing subdom
rm -f /home/username/public_html/subdom
ln -s /home/username/rails_apps/myapp/public /home/username/public_html/subdom

Resources