Documente Academic
Documente Profesional
Documente Cultură
This is a slightly modified versions of the installation guide at DevChix wiki: http://www.wiki.devchix.com/index.php?title=WindowsInstaller_-_Rails_3
Install Rails
Go to http://railsinstaller.org/ and download the kit. This kit includes Rails, Ruby, DevKit, Git, and SQLite. Click on the downloaded file to run the install wizard. Click Next at each step to accept the defaults. Be sure to check the box for "Add executables for Ruby, Git and DevKit to the PATH"
Rails will be installed in C:\RailsInstaller and the directory for your Rails projects will be C:\Sites
From the Windows Start menu, go to Programs, RailsInstaller, Command Prompt with Ruby and Rails The first time you run this program, it will ask you to enter your name and email address. After doing this, test your Ruby install in the command prompt using the -v version flag ruby -v
You should see something like ruby 1.9.2p... Test your Rails install in the command prompt using the -v version flag rails -v You should see something like Rails 3.1.3
In the instructions below, where it says: "In the command prompt type:", you can, much more easily, copy the command from this page, and right click in the menu bar or command prompt window, then click on "Paste", then hit the <enter> key.
Install Editor
You can use any editor of your choice. Sublime Text is an elegant Windows editor. Your could also use Notepad++.
rails generate scaffold user name:string email:string address:text active:boolean rake db:migrate rails server In the browser, visit http://localhost:3000/users Click New user to create a user to make sure we can save to the database. (The window where you ran rails server will display debugging information as you do so.) In your Command Prompt with Ruby and Rails window where you ran rails server, type control-c to kill(stop) the server.
Edit your Gemfile and change the line: gem 'sqlite3' To this: group :development, :test do gem 'sqlite3' end group :production do gem 'pg' end Prepare your rails app for deploying to Heroku $ bundle install --without production Add the changes to git repository and push to heroku $ git add . $ git commit -m "Updates for heroku deployment" $ git push heroku master It may ask: "The authenticity of host 'heroku.com (75.101.145.87)' can't be established. RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad. Are you sure you want to continue connecting (yes/no)?" Type yes and hit <enter>. Output of successful first deploy. Be sure to find your Heroku application name in the output. (What to do if git seems stuck) In the Command Prompt with Ruby and Rails window type: heroku rake db:migrate (Output of heroku rake db:migrate) In the browser, go to your application's URL. You'll need your Heroku application name. The URL for your app is application name.heroku.com - so with the example output in the previous step, it would be floating-winter-18.heroku.com. Verify you see the welcome page. Leave this browser window open. In the browser, add /users to the end of the URL. Verify you see the user list page. Create a new user to verify you can write to the db on Heroku.