Installing and Configuring Ruby on Rails in Kali Linux

Step-by-step installing and configuring Ruby on Rails in Kali Linux :


root@kali:~/Desktop# apt-get install build-essential libapache2-mod-passenger apache2 ruby rdoc ruby-dev libopenssl-ruby rubygems
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'ruby' instead of 'rdoc'
Note, selecting 'libruby' instead of 'libopenssl-ruby'
apache2 is already the newest version.
build-essential is already the newest version.
build-essential set to manually installed.
rubygems is already the newest version.
rubygems set to manually installed.
Suggested packages:
ri rails ruby-passenger-doc
The following NEW packages will be installed:
libapache2-mod-passenger libev4 libruby ruby ruby-dev ruby-passenger
ruby1.9.1-dev
0 upgraded, 7 newly installed, 0 to remove and 78 not upgraded.
Need to get 3,222 kB of archives.
After this operation, 9,702 kB of additional disk space will be used.
Get:1 http://http.kali.org/kali/ kali/main libev4 i386 1:4.11-1 [40.0 kB]
Get:2 http://http.kali.org/kali/ kali/main ruby all 1:1.9.3 [6,484 B]
Get:3 http://http.kali.org/kali/ kali/main ruby-passenger i386 3.0.13debian-1+deb7u1 [1,531 kB]
Get:4 http://http.kali.org/kali/ kali/main libapache2-mod-passenger i386 3.0.13debian-1+deb7u1 [243 kB]
Get:5 http://http.kali.org/kali/ kali/main libruby all 1:1.9.3 [6,218 B]
Get:6 http://http.kali.org/kali/ kali/main ruby1.9.1-dev i386 1.9.3.194-8.1+deb7u2 [1,390 kB]
Get:7 http://http.kali.org/kali/ kali/main ruby-dev all 1:1.9.3 [6,082 B]
Fetched 3,222 kB in 1min 33s (34.3 kB/s)
Selecting previously unselected package libev4.
(Reading database ... 330880 files and directories currently installed.)
Unpacking libev4 (from .../libev4_1%3a4.11-1_i386.deb) ...
Selecting previously unselected package ruby.
Unpacking ruby (from .../ruby_1%3a1.9.3_all.deb) ...
Selecting previously unselected package ruby-passenger.
Unpacking ruby-passenger (from .../ruby-passenger_3.0.13debian-1+deb7u1_i386.deb) ...
Selecting previously unselected package libapache2-mod-passenger.
Unpacking libapache2-mod-passenger (from .../libapache2-mod-passenger_3.0.13debian-1+deb7u1_i386.deb) ...
Selecting previously unselected package libruby.
Unpacking libruby (from .../libruby_1%3a1.9.3_all.deb) ...
Selecting previously unselected package ruby1.9.1-dev.
Unpacking ruby1.9.1-dev (from .../ruby1.9.1-dev_1.9.3.194-8.1+deb7u2_i386.deb) ...
Selecting previously unselected package ruby-dev.
Unpacking ruby-dev (from .../ruby-dev_1%3a1.9.3_all.deb) ...
Processing triggers for man-db ...
Setting up libev4 (1:4.11-1) ...
Setting up ruby (1:1.9.3) ...
Setting up ruby-passenger (3.0.13debian-1+deb7u1) ...
Setting up libapache2-mod-passenger (3.0.13debian-1+deb7u1) ...
[....] Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
. ok
Setting up libruby (1:1.9.3) ...
Setting up ruby1.9.1-dev (1.9.3.194-8.1+deb7u2) ...
Setting up ruby-dev (1:1.9.3) ...
root@kali:~/Desktop# aptitude install ruby libzlib-ruby rdoc irb
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 78 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

root@kali:~/Desktop# irb
irb(main):001:0> 3+5
=> 8
irb(main):002:0> foo="bar"
=> "bar"
irb(main):003:0> 4*20
=> 80
irb(main):004:0> exit
root@kali:~/Desktop# gem install rails --include-dependencies
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Fetching: i18n-0.6.9.gem (100%)
Fetching: tzinfo-0.3.38.gem (100%)
Fetching: minitest-4.7.5.gem (100%)
Fetching: atomic-1.1.14.gem (100%)
Building native extensions. This could take a while...
Fetching: thread_safe-0.1.3.gem (100%)
Fetching: activesupport-4.0.2.gem (100%)
Fetching: builder-3.1.4.gem (100%)
Fetching: rack-1.5.2.gem (100%)
Fetching: rack-test-0.6.2.gem (100%)
Fetching: actionpack-4.0.2.gem (100%)
Fetching: activemodel-4.0.2.gem (100%)
Fetching: arel-4.0.1.gem (100%)
Fetching: activerecord-deprecated_finders-1.0.3.gem (100%)
Fetching: activerecord-4.0.2.gem (100%)
Fetching: polyglot-0.3.3.gem (100%)
Fetching: treetop-1.4.15.gem (100%)
Fetching: mail-2.5.4.gem (100%)
Fetching: actionmailer-4.0.2.gem (100%)
Fetching: thor-0.18.1.gem (100%)
Fetching: railties-4.0.2.gem (100%)
Fetching: bundler-1.5.2.gem (100%)
Fetching: hike-1.2.3.gem (100%)
Fetching: sprockets-2.10.1.gem (100%)
Fetching: sprockets-rails-2.0.1.gem (100%)
Fetching: rails-4.0.2.gem (100%)
Successfully installed i18n-0.6.9
Successfully installed tzinfo-0.3.38
Successfully installed minitest-4.7.5
Successfully installed atomic-1.1.14
Successfully installed thread_safe-0.1.3
Successfully installed activesupport-4.0.2
Successfully installed builder-3.1.4
Successfully installed rack-1.5.2
Successfully installed rack-test-0.6.2
Successfully installed actionpack-4.0.2
Successfully installed activemodel-4.0.2
Successfully installed arel-4.0.1
Successfully installed activerecord-deprecated_finders-1.0.3
Successfully installed activerecord-4.0.2
Successfully installed polyglot-0.3.3
Successfully installed treetop-1.4.15
Successfully installed mail-2.5.4
Successfully installed actionmailer-4.0.2
Successfully installed thor-0.18.1
Successfully installed railties-4.0.2
Successfully installed bundler-1.5.2
Successfully installed hike-1.2.3
Successfully installed sprockets-2.10.1
Successfully installed sprockets-rails-2.0.1
Successfully installed rails-4.0.2
25 gems installed
Installing ri documentation for i18n-0.6.9...
Installing ri documentation for tzinfo-0.3.38...
Installing ri documentation for minitest-4.7.5...
Installing ri documentation for atomic-1.1.14...
Installing ri documentation for thread_safe-0.1.3...
Installing ri documentation for activesupport-4.0.2...
Installing ri documentation for builder-3.1.4...
Installing ri documentation for rack-1.5.2...
Installing ri documentation for rack-test-0.6.2...
Installing ri documentation for actionpack-4.0.2...
Installing ri documentation for activemodel-4.0.2...
Installing ri documentation for arel-4.0.1...
Installing ri documentation for activerecord-deprecated_finders-1.0.3...
Installing ri documentation for activerecord-4.0.2...
Installing ri documentation for polyglot-0.3.3...
Installing ri documentation for treetop-1.4.15...
Installing ri documentation for mail-2.5.4...
Installing ri documentation for actionmailer-4.0.2...
Installing ri documentation for thor-0.18.1...
Installing ri documentation for railties-4.0.2...
Installing ri documentation for bundler-1.5.2...
Installing ri documentation for hike-1.2.3...
Installing ri documentation for sprockets-2.10.1...
Installing ri documentation for sprockets-rails-2.0.1...
Installing ri documentation for rails-4.0.2...
file 'lib' not found
Installing RDoc documentation for i18n-0.6.9...
Installing RDoc documentation for tzinfo-0.3.38...
Installing RDoc documentation for minitest-4.7.5...
Installing RDoc documentation for atomic-1.1.14...
Installing RDoc documentation for thread_safe-0.1.3...
Installing RDoc documentation for activesupport-4.0.2...
Installing RDoc documentation for builder-3.1.4...
Installing RDoc documentation for rack-1.5.2...
Installing RDoc documentation for rack-test-0.6.2...
Installing RDoc documentation for actionpack-4.0.2...
Installing RDoc documentation for activemodel-4.0.2...
Installing RDoc documentation for arel-4.0.1...
Installing RDoc documentation for activerecord-deprecated_finders-1.0.3...
Installing RDoc documentation for activerecord-4.0.2...
Installing RDoc documentation for polyglot-0.3.3...
Installing RDoc documentation for treetop-1.4.15...
Installing RDoc documentation for mail-2.5.4...
Installing RDoc documentation for actionmailer-4.0.2...
Installing RDoc documentation for thor-0.18.1...
Installing RDoc documentation for railties-4.0.2...
Installing RDoc documentation for bundler-1.5.2...
Installing RDoc documentation for hike-1.2.3...
Installing RDoc documentation for sprockets-2.10.1...
Installing RDoc documentation for sprockets-rails-2.0.1...
Installing RDoc documentation for rails-4.0.2...
file 'lib' not found
root@kali:~/Desktop# aptitude install apache libapache-mod-fastcgi libfcgi-ruby1.8
No candidate version found for apache
Couldn't find any package whose name or description matched "libapache-mod-fastcgi"
No candidate version found for apache
Couldn't find any package whose name or description matched "libapache-mod-fastcgi"
The following NEW packages will be installed:
libfcgi-ruby1.8 libfcgi0ldbl{a}
0 packages upgraded, 2 newly installed, 0 to remove and 78 not upgraded.
Need to get 297 kB of archives. After unpacking 901 kB will be used.
Do you want to continue? [Y/n/?] Y
Get: 1 http://http.kali.org/kali/ kali/main libfcgi0ldbl i386 2.4.0-8.1 [281 kB]
Get: 2 http://http.kali.org/kali/ kali/main libfcgi-ruby1.8 i386 0.8.8-1 [16.1 kB]
Fetched 297 kB in 17s (17.4 kB/s)
Selecting previously unselected package libfcgi0ldbl.
(Reading database ... 331088 files and directories currently installed.)
Unpacking libfcgi0ldbl (from .../libfcgi0ldbl_2.4.0-8.1_i386.deb) ...
Selecting previously unselected package libfcgi-ruby1.8.
Unpacking libfcgi-ruby1.8 (from .../libfcgi-ruby1.8_0.8.8-1_i386.deb) ...
Setting up libfcgi0ldbl (2.4.0-8.1) ...
Setting up libfcgi-ruby1.8 (0.8.8-1) ...

root@kali:~/Desktop# cd /var/www/
root@kali:/var/www# mkdir rails
root@kali:/var/www# chown -R www-data:www-data /rails
chown: cannot access `/rails': No such file or directory
root@kali:/var/www# aptitude install libmysql-ruby
The following NEW packages will be installed:
libmysql-ruby ruby-mysql
0 packages upgraded, 2 newly installed, 0 to remove and 78 not upgraded.
Need to get 97.6 kB of archives. After unpacking 373 kB will be used.
Do you want to continue? [Y/n/?] Y
Get: 1 http://http.kali.org/kali/ kali/main ruby-mysql i386 2.8.2+gem2deb-3 [91.8 kB]
Get: 2 http://http.kali.org/kali/ kali/main libmysql-ruby all 2.8.2+gem2deb-3 [5,796 B]
Fetched 97.6 kB in 19s (5,107 B/s)
Selecting previously unselected package ruby-mysql.
(Reading database ... 331151 files and directories currently installed.)
Unpacking ruby-mysql (from .../ruby-mysql_2.8.2+gem2deb-3_i386.deb) ...
Selecting previously unselected package libmysql-ruby.
Unpacking libmysql-ruby (from .../libmysql-ruby_2.8.2+gem2deb-3_all.deb) ...
Setting up ruby-mysql (2.8.2+gem2deb-3) ...
Setting up libmysql-ruby (2.8.2+gem2deb-3) ...

root@kali:/var/www#
root@kali:/var/www# mkdir rails
root@kali:/var/www# chown -R www-data:www-data /rails
root@kali:~# cd /var/www/rails/
root@kali:/var/www/rails# rails blog
Usage:
rails new APP_PATH [options]

Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /usr/bin/ruby1.9.1
-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.
root@kali:/var/www/rails# rails new blog
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/views/layouts/application.html.erb
create app/assets/images/.keep
create app/mailers/.keep
create app/models/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/bundle
create bin/rails
create bin/rake
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/filter_parameter_logging.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/initializers/wrap_parameters.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/robots.txt
create test/fixtures
create test/fixtures/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
/var/lib/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/friendly_errors.rb:10:in `rescue in with_friendly_errors': uninitialized constant Thor::AmbiguousTaskError (NameError)
from /var/lib/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /var/lib/gems/1.9.1/gems/bundler-1.5.2/bin/bundle:20:in `
'
root@kali:/var/www/rails#


Thank you

Postingan terkait:

Belum ada tanggapan untuk "Installing and Configuring Ruby on Rails in Kali Linux"

Post a Comment