Rails new command - ruby-on-rails

I just downloaded Ruby on Rails through RailsInstaller. I've seen on a tutorial that to start a new project, I had to tap rails new + the name of my new app on the terminal. But when I do that, I've got an error :
Error
The specified path was not found
Does anyone have an idea to help me ?
Thanks ;)

You need to ensure that the rails command is available in your PATH...I think the problem is not rails new, but rather the fact that your shell does not know where to find the rails command.

Related

why rails server is not working on windows 10

I have created the new rails project and trying to run it without doing any changes. I am using the power shell in windows 10. When I am running the rails s command its not starting the server. Please see attached image. I have highlighted the installed ruby version.
The error is there in the output, you do not have a rails app to start a server for, you can create a new app with:
rails new <name-for-your-app>
Follow along this tutorial
to help you get started with rails.
I think this command will work or you are missing something which is required to run rails server
bin/rails server
I've got similar error when I am not in rails project directory. Seems you are out of directory.
Please run those full commands in powershell
cd c:/
rails new testapp
cd testapp
rails s

Downloaded project from Github, rails server won't start

Downloaded a project from Github and I am having issues getting the rails server to start. I ran the bundle install and am definitely in the right directory, is there anything that I've missed that you're supposed to do?
http://pastebin.com/rjhkQkZk
Run rails server. If there is another error, please provide more information:
Operating System
Rails Version
Log
Make sure you are at the root (directory) of the project you downloaded. And then try this command:
rails s
It would be really nice if we could learn what your log entries say.
In your terminal set the ruby source and go to the Root directory.
hit rails s or rails server
Stupid, stupid noob mistake - it's with sinatra not rails. Sorry to waste your time, guys.

Error: Rails command not found

I created a new Rails project in a directory, say Desktop (rails new project1). After that, I ran the following command:
rails server
Then, the project1 was running on localhost.
After that, I made another directory with name (project1) in another location. I copied all the files from the previous location to new location. After that, when I ran the following command:
rails server
I got the following error message:
Rails is not currently installed on this system.
But it is working in the previous directory. How do I solve this?
If you are totally new to Rails development and System administration it is rather complicated in the beginning. I recommend any kind of Rails tutorial to you for examply by Michael Hartl .
As Graeme McLean points out you somewhen understand that there is information about your environment needed to help you.
Most likely the requirements you need to be set up are not set up in the place you did copy your rails project as Pavan and Thaha kp pointed out.

Cannot start project in rails

I'm pretty new to Rails.
I created a new Rails app: rails new app_name, and ran rails server etc.
But, once I shut down and reopened my machine, I can run neither rails server nor rails console. It says to use the rails new app_name command again, but I just want to restart where I left off the day before.
Any advice is very much appreciated.
I'm guessing your current working directory of your command line is not in your project directory which you created yesterday.
cd some_path/to_my/rails_project
rails server
You must be in the directory that represents your project to do things like launch the server. Otherwise, how does it know what project to launch a server for?
Just make sure you are in the directory of the rails app you created. Sounds like you aren't.

Need help with my rails 3 environment

pulled down a repo from git. For some reason I need to do
./script/rails.rb s
where on the rails 3 ap I started on my box, I can just do the
rails server
can anyone help me set up my environment so I don't have to do this? I'm still trying to figure out what I need to type to do a migration...
I think I've figured this out. The repo you downloaded was from somebody developing on a Windows machine. They have to add the ".rb" extention to script/rails to get it to work right.
Calling rails server is really just an alias for script/rails. But you're getting an error because when you type rails server, script/rails isn't there.
The solution is easy: in your local copy of that project, rename script/rails.rb back to script/rails the way it should be.
Also, rails s and rails server are the same thing - one is just a shortcut.

Resources