WEBrick server

hi all,
How to install WEBrick server in ubuntu14.0

Hi,

No need to install WEBrick, it will inside Ubuntu package.

Thanks.

Thanks & Regards,
Kanna

On 11 December 2015 at 10:25, Naresh J. [email protected] wrote:

hi all,
How to install WEBrick server in ubuntu14.0

There is no Ubuntu 14.0, perhaps you mean 14.04.

What exactly are you trying to do? Do you mean that you want it to be
used when you run rails s? If so then which version of rails are you
using?

Colin

@Naresh J.,

You need to change directory to app like below

  1. create new rails app with command:
    rails new app_name

  2. then cd to directory the command is:

    cd app_name

  3. then bundle update

bundle install

  1. modify db config file in config directory

    rake db:create db:migrate

  2. then start server

    rails s

so, keep in mind it is very basic common commands to run rails app in
machine.

Colin L. wrote in post #1179830:

On 11 December 2015 at 10:25, Naresh J. [email protected] wrote:

hi all,
How to install WEBrick server in ubuntu14.0

There is no Ubuntu 14.0, perhaps you mean 14.04.

What exactly are you trying to do? Do you mean that you want it to be
used when you run rails s? If so then which version of rails are you
using?

Colin

Hi Colin,

my rails version is 4.0.2,ruby version is 1.9.3p484 and i am trying to
design login page but when i try to start rails server following is
message coming and i am not able open on the browser by localhost
because it doesnot display any port number

guest-QI1NUN@bitstack-vindhya:~$ rails s
Usage:
rails new APP_PATH [options]

Options:
-r, [–ruby=PATH] # Path to the Ruby binary of your
choice
# Default: /usr/bin/ruby
-m, [–template=TEMPLATE] # Path to some application template
(can be a filesystem path or URL)
[–skip-gemfile] # Don’t create a Gemfile
-B, [–skip-bundle] # Don’t run bundle install
-G, [–skip-git] # Skip .gitignore file
[–skip-keeps] # Skip source control .keep files
-O, [–skip-active-record] # Skip Active Record files
-S, [–skip-sprockets] # Skip Sprockets files
-d, [–database=DATABASE] # Preconfigure for selected database
(options:
mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
-j, [–javascript=JAVASCRIPT] # Preconfigure for selected JavaScript
library
# Default: jquery
-J, [–skip-javascript] # Skip JavaScript files
[–dev] # Setup the application with Gemfile
pointing to your Rails checkout
[–edge] # Setup the application with Gemfile
pointing to Rails repository
-T, [–skip-test-unit] # Skip Test::Unit files
[–rc=RC] # Path to file containing extra
configuration options for rails command
[–no-rc] # Skip loading of extra configuration
options from .railsrc file

Runtime options:
-f, [–force] # Overwrite files that already exist
-p, [–pretend] # Run but do not make any changes
-q, [–quiet] # Suppress status output
-s, [–skip] # Skip files that already exist

Rails options:
-h, [–help] # Show this help message and quit
-v, [–version] # Show Rails version number and quit

Description:
The ‘rails new’ command creates a new Rails application with a
default
directory structure and configuration at the path you specify.

You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home

directory.

Note that the arguments specified in the .railsrc file don't affect

the
defaults values shown above in this help message.

Example:
rails new ~/Code/Ruby/weblog

This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
See the README in the newly created application to get going.

On 12 December 2015 at 05:28, Naresh J. [email protected] wrote:

Usage:
rails new APP_PATH [options]

That usually means you are trying to ‘run rails s’ from the wrong
directory. You must run it from the root of the rails application.
So you did
rails new my_app
then you must do
cd my_app
to enter that directory, then if you run ls you should see the
directories app, config and so on. Then you can run
rails s

However, I guess that you are a newcomer to Rails so suggest you start
by working right through a good tutorial such as railstutorial.org
(which is free to use online) which will show you the basics of Rails.

Colin

Sai Ch wrote in post #1179852:

@Naresh J.,

You need to change directory to app like below

  1. create new rails app with command:
    rails new app_name

  2. then cd to directory the command is:

    cd app_name

  3. then bundle update

bundle install

  1. modify db config file in config directory

    rake db:create db:migrate

  2. then start server

    rails s

so, keep in mind it is very basic common commands to run rails app in
machine.

@Sai ch

Hi sai,

Thanque its working but i didnt change anything in config.ru is this
necessary to change as you mentioned in 4th step i just copy “rake
db:create db:migrate” this in config file but it shown error so i just
removed that but my server is start then what is the purpose of that 4th
step

Naresh JIlla

Thanque colin

On 12 December 2015 at 09:28, Naresh J. [email protected] wrote:

cd app_name

necessary to change as you mentioned in 4th step i just copy “rake
db:create db:migrate” this in config file but it shown error so i just
removed that but my server is start then what is the purpose of that 4th
step

Work through the tutorial I mentioned and all will become clear (well,
less muddy anyway).

Cheers

Colin

Colin L. wrote in post #1179858:

On 12 December 2015 at 09:28, Naresh J. [email protected] wrote:

cd app_name

necessary to change as you mentioned in 4th step i just copy “rake
db:create db:migrate” this in config file but it shown error so i just
removed that but my server is start then what is the purpose of that 4th
step

Work through the tutorial I mentioned and all will become clear (well,
less muddy anyway).

Cheers

Colin

Once again thanque sir i just started from scratch as you mentioned and
execute my first ruby project successfully, can i expect your support in
further also…?

Naresh J.

On 13 December 2015 at 06:35, Naresh J. [email protected] wrote:

less muddy anyway).

Cheers

Colin

Once again thanque sir i just started from scratch as you mentioned and
execute my first ruby project successfully, can except your support in
further also

Glad to be of help

Colin

hi,
i just create normal form and my form is diplays fine but when i am
entering values in the field it will shown following error

ActiveModel::ForbiddenAttributesError
Extracted source (around line #6):

4.end
5.def create
6.@student = Student.new(params[:student])
7.if @student.save
8.redirect_to new_student_path
9.end

This is my controller

class StudentsController < ApplicationController
def new
@student = Student.new
end
def create
@student = Student.new(params[:student])
if @student.save
redirect_to new_student_path
end
end
end

On 13 December 2015 at 14:11, Naresh J. [email protected] wrote:

hi,
i just create normal form and my form is diplays fine but when i am
entering values in the field it will shown following error

ActiveModel::ForbiddenAttributesError
Extracted source (around line #6):

Have you worked right through the tutorial I suggested, including the
exercises?

Colin

4.end
@student = Student.new
end
def create
@student = Student.new(params[:student])
if @student.save
redirect_to new_student_path
end
end
end

You need a Strong Parameters - compliant params getter method in your
controller. Have a read here:

for more information.

Walter