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

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.

Related

how to fix error: chmod on /mnt/x/coding/webapp/.git/config.lock failed: Operation not permitted fatal: could not set 'core.filemode' to 'false'

almanex#LAPTOP-GHRH09TN:~$ cd /mnt/x/
almanex#LAPTOP-GHRH09TN:/mnt/x$ mkdir -p coding
almanex#LAPTOP-GHRH09TN:/mnt/x$ cd coding
almanex#LAPTOP-GHRH09TN:/mnt/x/coding$ rails new webapp
create
create README.md
create Rakefile
create .ruby-version
create config.ru
create .gitignore
create Gemfile
run git init from "."
error: chmod on /mnt/x/coding/webapp/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'
Hello, I'm trying to create an app on rails but there is an issue with chmod, I've searched the net but there is only one solution that I found and already tried (as you can see): creating the directory with -p option. This did not help. Do you have some ideas what should I do?
I had this same issue but with git clone, adding a sudo before the command fixed it for me.
ie sudo rails new webapp

-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.

Using the Command-line Command to launch Sublime Text 2 on OS X

I just started reading Michael Hartl's book on Rails and I've run across a problem in the setup phase. Hartl keeps referring to making a file in my home directory, but I'm not quite sure how to do this. For example, when I try to setup the command line for sublime text the instructions tell me to do this: Assuming you've placed Sublime Text 2 in the Applications folder, and that you have a ~/bin directory in your path, you can run:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
My problem is that I don't know how to put a ~/bin directory in my path. I know this is real basic but any help would be greatly appreciation.
create or edit ~/.profile (works with both bash and zsh)
add the following
export PATH=$PATH:$HOME/bin
The line above is saying, overwrite the PATH environment variable and set it to the previous path plus ~/bin
Now when you try to run a command, bash will look in all the colon separated paths in your PATH environment variable for an executable.
To see your entire PATH, type echo $PATH in a terminal. Or better yet, type env to see all environment variables.
On your terminal
$ mkdir ~/bin
$ sudo ln -s "/Applications/Sublime Text2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
Edit ~/.base_profile
export PATH=$PATH:~/bin
usage:
open current directory:
subl .
In your ~/.bashrc file add to the end:
PATH="$HOME/bin:$PATH"

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>.

mongrel_rails start command not found

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.

Resources