From InstantRails To RubyStack

From InstantRails To RubyStack


Many of us at BitNami got started with Ruby on Rails using InstantRails and would like to acknowledge the excellent work done by its authors. We would like for InstantRails users to feel at home with RubyStack. For that reason, we created this mini-guide to cover the main differences between InstantRails and RubyStack.


RubyStack is an installer, not a zip file

Being an installer allows us to simplify some configuration steps in a wizard-like manner. One of the reasons that people dislike installers is that they tend to modify the system in a variety of places. Rest assured this is not the case with RubyStack. We do not add any extra variables or registry settings or copy files outside of the installation directory. We install MySQL as a service, but it will removed upon uninstallation. Future versions of RubyStack will allow you to choose whether you want to install MySQL as a service or start it manually. We are also looking into creating a version of RubyStack that can be distributed as a zip file, but that is still a bit further in the future.


Do you ship Apache?

Yes, we ship Apache 2.2, in addition to Mongrel and Webrick.


Do you ship phpMyAdmin?

Yes, we ship PHP and phpMyAdmin as an easy to use GUI for MySQL.


RubyStack does not have a tray icon. How can I start/stop services like MySQL?

You can use the Start Menu entries to start/stop needed services (like MySQL):

Start -> All Programs -> BitNami RubyStack -> BitNami RubyStack Service -> Start BitNami RubyStack Service

And you can launch your application server "the Rails way" (see "How can I start my web application?").



How can I start my web application?

Launch "Use Ruby" from the Start Menu, go to your Rails application's directory and start the server. With a default configuration and step by step:

Start -> All Programs -> BitNami RubyStack -> Use Ruby

And then:

cd projects\rubystack
ruby script/server


How can I stop my web application?

Just close the window were the server is running or press Ctrl+C.


How can I access my web application?

Ensure that you are running the application server (see "How can I start my web application?") and then point your web browser to http://localhost:3000/.


How do I upgrade RubyStack?

Nearly in the same way you did with InstantRails:

Download and install the new version of RubyStack in another directory.
Move your rails application to the new location of RubyStack (this step is recommended but not needed).
Copy your database files to the new installation by copying the entire contents of C:\Program Files\BitNami RubyStack\mysql\data to the new location of RubyStack.
Restart the RubyStack service through Start Menu.


How do I create another Rails application?

We already created and configured a default Rails application for you. By default it is located at C:\Program Files\BitNami RubyStack\projects\rubystack. If you want to create another one follow the steps below:

First of all launch an "Use Ruby" console:

Start -> All Programs -> BitNami RubyStack -> Use Ruby

Move to the "projects" directory and tell Rails to create a new application:

cd projects
rails may_new_app

Connect to the MySQL database (assuming that your MySQL port is 3306):

mysql -u root -p --port=3306

If you do not remember your MySQL port or password, check the "Installation Report" in the Start Menu. Now, you can create the appropriated databases:

CREATE DATABASE IF NOT EXISTS my_new_app_production;
CREATE DATABASE IF NOT EXISTS my_new_app_development;
CREATE DATABASE IF NOT EXISTS my_new_app_test;
exit

Create the corresponding configuration file C:\Program Files\BitNami RubyStack\projects\my_new_app\configure\database.yml with the following content (do not forget spaces):

development:
  adapter: mysql
  database: my_new_app_development
  username: root
  password: your-password-here
  host: localhost
  port: 3306

test:
  adapter: mysql
  database: my_new_app_test
  username: root
  password: your-password-here
  port: 3306

production:
  adapter: mysql
  database: my_new_app_production
  username: root
  password: your-password-here
  port: 3306

你可能感兴趣的:(Web,mysql,REST,Ruby,Rails)