why rails server is not working on windows 10 - ruby-on-rails

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

Related

Can I use gitlab-rails to create a new rails app?

I have installed gitlab with the omnibus package on a Ubuntu-based machine, on which I'm trying to develop a rails app as well. Since gitlab installs ruby and the rails framework for itself, could I be able to use it to create new rails applications? When I run gitlab-rails new app_name under my home directory I get an error message that reads:
/usr/bin/gitlab-rails error: could not load /opt/gitlab/etc/gitlab-rails/gitlab-rails-rc
Either you are not allowed to read the file, or it does not exist yet.
You can generate it with: sudo gitlab-ctl reconfigure
And when I run sudo gitlab-rails new app_name I get:
Can't initialize a new Rails application within the director of another, please change to a non-Rails directory first.
Type 'rails' for help
I've tried to run this under newly created, empty directories, but keep getting the same message. I assume gitlab-rails tries to create the new app under the gitlab project directory for some reason?
As far as I know, this isn't the purpose of the gitlab-rails command and isn't a supported functionality. It'd be a much better idea to create a new Rails app by just using the Rails gem itself.

how do I start Webrick server on windows 10?

I am very new to Ruby on Rails. As I was setting up...everthing seem to be going fine until I ran "rails s".Webrik didnt start!
my OS is Windows 10.
I am using this tutorial http://installfest.railsbridge.org/installfest/windows
At first you need to create new app rails new my_app then switch folder to /my_app and then you can do rails s
you have to read your logs

Running Webrick in Windows - Help getting started with Rails

I'm new to Ruby on Rails (and programming!) and am running through the guide here...
http://guides.rubyonrails.org/getting_started.html
However I am stumped on step 4.1. Creating a webserver as Webrick does not seem to run at all. Here is the error message that I see...
F:/Documents/Google Drive/Development/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4
.2.0/lib/rails/app_rails_loader.rb:39:in `exec': No such file or directory - "F:
/Documents/Google Drive/Development/Ruby21/bin/ruby.exe" (Errno::ENOENT)
The Ruby.exe does indeed exist in this location, all previous steps have been fine up until now. Any help would be much appreciated!
Is Ruby and Rails installed locally or is it in an external flash drive or cloud storage? You might need to reinstall everything into your C:\ drive to run a local server.
Also, did you copy the command from the guide verbatim? If you're running windows and using a cmd prompt, you don't need to include the "bin/" part of that command. Simply enter "rails server" or "rails s" for short to start the server.

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.

cannot run rails server command for already created project

I have got an application which was zipped and I unzipped the files and it gave me a folder with all the required structure of a rails application. But when I am going inside the directory and running the rails server command, its not doing anything, but showing me the list of options rails command can do. What would have been the problem?
thanks
Maybe this will help from app folder try:
ruby script/rails server
As explained by Dave Isaacs, Showing the list of options is what the rails command does when it is executed outside the context of an application (i.e., not in the application directories).
Type the full command, including the /script path to the CLI.
script/rails server
instead of
rails server
where script is the path to the rails command that, in a Rails 3 application, lives in the script folder.
I would assume that the application you got was written with rails 2.x. In that case, you have to start it with
script/server

Resources