简体   繁体   中英

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?

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.

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

Step by Step rails server Installation :

  1. Create Gemset using " rvm create gemset "
  2. rails new
  3. goto rails app directory "cd/"
  4. gem install rails
  5. echo "rvm use " > .rvmrc for example : echo "rvm use 1.9.3-p385@mygemset" > .rvmrc
  6. run - "bundle install"
  7. rails s

yeah, nothing to do more... :)

I had this problem on Ubuntu and found that I had rails 3 installed with gem and rails 2 installed with apt. Removing the apt version solved the issue:

sudo apt-get remove rails

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM