Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
489 views
in Technique[技术] by (71.8m points)

install ruby on rails on windows

I need to run an application built in ruby on rails. I have installed ruby 1.9.2, rails 3.2.1, gem 1.8.15, Netbeans 6.8, glassfish v3, jdk6u30 and mysql but still, I can't get it run.

How do I install ruby on rails on WindowsXP?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have to code on Windows at work and deploy to Linux and this is what I use

  1. Ruby installer
  2. Ruby Dev Kit
  3. Install Rubygems
  4. Open a Ruby command prompt for the next steps
  5. gem install bundler
  6. bundle install mysql
  7. bundle install rails
  8. Go to the directory you want to house your rails apps (e.g. cd ails_source)
  9. rails new (inserting the app name you want)
  10. Once that is done, cd into the directory
  11. Edit Gemfile to ask for gem 'mysql'
  12. cd Config
  13. edit Database.yaml to look for mysql db
  14. cd ..
  15. create a db for your mysql instance called _development
  16. Go back to rails command line
  17. bundle exec rails g scaffold (like blog_entry)
  18. bundle exec rake db:migrate
  19. bundle exec rake routes
  20. Look for your desired route in the output
  21. bundle exec rails s
  22. Open a browser
  23. Go to http://localhot:3000/
  24. You should see a plain app

You can also check out Rails for Zombies which is a visual tutorial. It is not windows oriented but it helps fill in the gaps


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...