install ruby on rails on windows

前端 未结 2 1552
醉酒成梦
醉酒成梦 2020-12-22 03:06

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

相关标签:
2条回答
  • 2020-12-22 03:32

    I think its a quite simple to install ROR with mysql database on windows.

    Follow the below instruction

    1. Install Mysql Server 5.6 from [http://dev.mysql.com/downloads/mysql/] , use 32bit for XP and 64Bit for W7.
    2. Go to mysql/bin folder under Program Files and copy and set the path in environment variable.Open command propmt and type mysql in order to check if mysql is installed correctly.
    3. If still problem with Mysql, open run and type services.msc and check for MySQL service is started or not if not start manually.
    4. Download ruby2.0.0, devkit 64-32 from http://rubyinstaller.org/downloads/
    5. Download mysql connector from [http://dev.mysql.com/downloads/connector/c/] and make sure the version should be "(mysql-connector-c-noinstall-6.0.2-win32.zip)", you will find in "Looking for previous GA versions?".
    6. Install ruby in C folder and select add path to executable while installing in first/second prompt.
    7. Create folder devkit and extract devkit into it.
    8. Extract mysql connector in C folder.
    9. Open command Prompt and type ruby -v in order to check if ruby is installed, if not check ruby/bin path have to be added in environment variable.
    10. Go to devkit folder, where you have extracted devkit, open command prompt and type ruby dk.rb init and then ruby dk.rb install.
    11. Now we go through test, follow the instruction is given in test installation section in https://github.com/oneclick/rubyinstaller/wiki/Development-Kit and check with command starts with gem and ruby.
    12. Create directory called dev and go inside it and type command gem install rails.
    13. rails new app -d mysql2
    14. Run command "bundle config build.mysql2 --no-ri --no-rdoc -- --with-mysql-dir=c:\mysql-connector[select what folder name is there for mysql connector]".
    15. bundle install.
    16. If still problem is exist, delete app folder and repeat command rails new app -d mysql2 again.
    17. Go to app folder and use command rails server to start services. Check in browser with localhost:3000.
    18. To create DB, use rake db:create in app folder.

    Hope it helps.

    0 讨论(0)
  • 2020-12-22 03:33

    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 \rails_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

    0 讨论(0)
提交回复
热议问题