Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting a rails server in Rails 3

I have created a new rails project with the command:

rails project_name

but now in that project if I run:

rails server

I just creates a new project call server, it doesn't start webrick.

How do I start the server and get rails running?

like image 358
MintDeparture Avatar asked Dec 15 '10 21:12

MintDeparture


People also ask

How do I start a Rails server?

Go to your browser and open http://localhost:3000, you will see a basic Rails app running. You can also use the alias "s" to start the server: bin/rails s . The server can be run on a different port using the -p option. The default development environment can be changed using -e .

What happens when we start Rails server?

One of the things rails server does is that it loads all the dependencies/gems required by your Rails app, or at least sets them up to be auto-loaded later when they are needed. This is sometimes called "booting" or loading the "Rails environment".

What is the default Rails server?

Rails. Puma is the default server for Rails, included in the generated Gemfile.


2 Answers

Old versions or rails are bugging you. Deinstall them using gem uninstall rails. I recommend using RVM with gemsets to create separate environments for each project.

like image 108
iain Avatar answered Nov 02 '22 23:11

iain


You're mixing Rails 2 and Rails 3 commands. By the looks of it, you're using Rails 2, which means starting the server would be script/server, not rails server

like image 28
idlefingers Avatar answered Nov 03 '22 00:11

idlefingers