Ruby On Rails First Basic Application without Gems

Now You Guys already Read about Ruby on Rails overview, Now Lets start to create a Basic application which is not belong to any gems(widgets)



But First, Before Create any Application you guys should know about few things which is so important for your blog.

1. Rails Framework
2. Models, Views and Controllers
3. Web Servers

Now, Lets create First Web Application witch
is not related with any gem file, its just a basic.

Creating the Blog Application
$ rails new blog
Open your terminal and take a look of the path where you want to create this application. In my case I'm making the app on my Sites folder. So Just type the command in your terminal.

after type the command you will see that, you got a folder name "blog" which is in your site folders.

now go on this path (E.x. cd/Sites/blog), and type "ls"

you'll got few files and folders. which will look like this. Rails created by default:
File/FolderPurpose
app/Contains the controllers, models, views, helpers, mailers and assets for your application. You'll focus on this folder for the remainder of this guide.
bin/Contains the rails script that starts your app and can contain other scripts you use to deploy or run your application.
config/Configure your application's runtime rules, routes, database, and more. This is covered in more detail in Configuring Rails Applications
config.ruRack configuration for Rack based servers used to start the application.
db/Contains your current database schema, as well as the database migrations.
Gemfile
Gemfile.lock
These files allow you to specify what gem dependencies are needed for your Rails application. These files are used by the Bundler gem. For more information about Bundler, see the Bundler website
lib/Extended modules for your application.
log/Application log files.
public/The only folder seen to the world as-is. Contains the static files and compiled assets.
RakefileThis file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application.
README.rdocThis is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on.
test/Unit tests, fixtures, and other test apparatus. These are covered in Testing Rails Applications
tmp/Temporary files (like cache, pid and session files)
vendor/A place for all third-party code. In a typical Rails application, this includes Ruby Gems and the Rails source code (if you optionally install it into your project).

now just type the command:
$ rails server (or) rails s
This will fire up WEBrick, a webserver built into Ruby by default. To see your application in action, open a browser window and navigate to http://localhost:3000. You should see the Rails default information page, after done this all commands.

Note: this is just a basic application which we create without create any models, controllers and views. So we'll continue this article in next post.

Comments