Oomoo

August 19, 2008

Update Rails/Rake/Gems

Filed under: gems, rails, rake — oomoo @ 9:09 am

Keep your Rails/Rake/Gems up-to-date by running these commands:

Update the RubyGems system itself (required by Rails 2.0).
gem update –system

Update Rails-specific gems and installs any new components (specifically Active Resource).
gem install rails

Update Rake, the build tool used by Rails.
gem update rake

Update the Ruby bindings for the SQLite3 database.
gem update sqlite3-ruby
. 

For an existing project, also do this:

rake rails:update

…and edit the config/environment.rb file and set the correct GEM Version:

RAILS_GEM_VERSION = ‘2.1.0’ unless defined? RAILS_GEM_VERSION

You might want to make sure your migrations are up-to-date:

rake db:migrate
rake db:schema:dump

 

Check your GEM version:
gem –version

 

Downgrade/Rollback GEM
gem -v

 

List all the installed gems by typing:

gem list

. 

View the documentation for all the installed gems by typing:

gem server

To access the documentation, point your browser to http://localhost:8808/

This command starts a web server on port 8808 by default. 

You’ll see a list of the gems you have installed with a link to their RDoc documentation.

 

Install SQLite3:
gem install sqlite3-ruby

 

Force Rails to use MySQL (instead of the default SQLite3):

rails -d mysql myapp

 

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: