Changing Gemfile

As we've added new Gems to this project, we need to change part of the overall project configuration. This is contained in Gemfile, a simple list of Gems used in the project. The old version is as follows:

source :rubygems

gem "sinatra"
gem "thin"

The first line indicates a standard server for downloading Gems. This server has been deprecated for security reasons, so we'll change it in a moment.

Notice that Gemfile contains a line for the Sinatra Gem, which we referenced in the application, and an additional Gem, thin. This is a simple web server used by the Sinatra framework.

The modified Gemfile incorporates new Gems and a safer source:

source 'http://rubygems.org'

gem "sinatra"
gem "thin"
gem "json"
gem "mysql2"

When you modify Gemfile, you must incorporate changes using the following command:

bundle install

If you do not have "bundle" installed, you will have to install that gem before running bundle install. To do this, simply run the following command:

sudo gem install bundler

The AppFog requires this command in order to detect the Gems it must provide for you. The command also installs gems locally so that your local Gem set matches the one you're using on AppFog.

Once again update the AppFog version using the following command:

af update insideaf2

And you now have a database listing on the live site as shown in the following screenshot:

Changing Gemfile
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.183.210