SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
Ruby On Rails
 BeijingLUG



by Nathaniel Brown
    April 2007
Overview
●
    Install Ruby
●
    Install Rails
●
    (Optional) Install Eclipse
●
    Talk about Ruby
●
    Talk about Rails
●
    Example Application
●
    Links to Resources
Install Ruby
●
    sudo apt-get install ruby irb ri rdoc
●
    If you want to install mongrel you will also have
    to install the dev packages.
●
    sudo apt-get install ruby1.8-dev build-essential
Install Ruby Gems
●
    wget : http://rubyforge.org/frs/download.php/17190/
●
    tar xzvf rubygems-0.9.2.tgz
●
    cd rubygems-0.9.2
●
    sudo ruby setup.rb
●
    cd ..
●
    rm -rf rubygems-0.9.2
Install Rails and Mongrel
●
    sudo gem install rails --include-dependencies
●
    (Optional) sudo gem install mongrel --include-
    dependencies
●
    (Optional) Select the latest version of each
    library.
Install MySQL Server
●
    You could use PostgreSQL or SQLite instead
    but most examples use MySQL so we will as
    well.
●
    sudo apt-get install mysql-server phpmyadmin
    libmysql-ruby apache2 libapache2-mod-php5
(Optional) Install Eclipse
●
    sudo apt-get install eclipse sun-java5-jdk sun-
    java5-fonts
(Optional) Install RDT, RadRails and
       Aptana and Subclipse
●
    Open Eclipse and go to Help ->Software Updates
    -> Find and Install...
●
    Select “Search for new features to install” then
    click on “Next”.
●
    Add the following remote sites:
    RDT : http://updatesite.rubypeople.org/release
    RadRails : http://radrails.sourceforge.net/update
    Aptana : http://update.aptana.com/install/
    Subclipse : http://subclipse.tigris.org/update_1.2.x
●
    Once they have been added install all of them.
(Optional) Config RDT and RadRails
●
    Open Eclipse and go to Windows ->
    Preferences
●
    Find Ruby and add the Ruby interpreter.
●
    Find Rails and add the applications. They
    should all be in /usr/bin/*app name*
Ruby is a nice language
●
    Object Orientated
●
    Automatic garbage collection
●
    Sane readable code that makes sense.
Ruby example code 1
●
    Is readable

    puts "leon".reverse.capitalize

    staff_list = ["joe", "steve", "bob"]
    staff_list.sort!
    staff_list.each do |first_name|
     puts first_name.capitalize
    end

    3.times do |zork| puts "#{zork} " end
Ruby example code 2
−Tells       you if it will change the variable.
my_string = "12345"
new_string = my_string.chop
puts "String chopped."
puts "my_string: #{my_string}"
puts "new_string: #{new_string}"

my_string = "98765"
puts "my_string: #{my_string}"
my_string.chop!
puts "String chopped."
puts "my_string: #{my_string}"

my_number = 999474
puts my_number.to_s.include?("94")

my_string = "This is a test."
puts "#{my_string[3..5]}"
puts "#{my_string[2]}"
my_string[10..13] = "Ruby"
puts my_string
Ruby example code 3

−Lots      of things are just done really nicely.
#create our thread array
threads = []

5.times do |i|
  #create 5 threads into the array        
  threads[i] = Thread.new do
    #wait a random amount of time, then print a message
    sleep(rand(10))
    puts "I am thread number #{i}"
  end
end

#let each thread finish before ending the program
threads.each {|t| t.join}
Rails is a nice Framework
●
    Rapid Application Development
●
    Caching
●
    Model View Controller
●
    Nice informative errors

●
    DRY – Don't Repeat Yourself.
●
    Convention over Configuration
Rails supports modern features
●
    AJAX is build into the framework but JavaScript
    isn't required.
●
    Pretty URLs
●
    Active Record which is a type of Object
    Relation Mapping (ORM)
Rails encourages good
           development practices
●
    Validation
●
    Unit testing
●
    Use of development, testing and production
    environments with sane settings for each of
    them. e.g. Development has caching turned off.
    Production and Testing have it turned on.
●
    Version control is encouraged and assumed.
The Bad
●
    No manual only books.
●
    Ruby is relatively slow. (See Language Shoot-
    out)
●
    Rails is database driven which means it scales
    with the database.
●
    You'll often have to do things the “Rails Way”.
    (But it's often the right way as well)
●
    Lots of the 3rd party libraries are still unstable.
    (Improving quickly)
Create Your First Rails Applications
●
    If you are reading this online then go to the links
    section find RadRail's home page. He has a
    fairly good tutorial using RadRails.
Resources Links
●
    Rails for Fedora -
    http://digitalmediaminute.com/howto/fc4rails/
●
    RDT - http://rubyeclipse.sourceforge.net/
●
    RadRails and Aptana - http://www.radrails.org/
●
    Language Shoot-out -
    http://shootout.alioth.debian.org/
Cheat Sheets Links
●
    Rails, CSS, Javascript, HTML, etc (A4) -
    http://www.ilovejackdaniels.com/
●
    Nice Rails summary -
    http://www.blainekendall.com/index.php/rubyonrails
●
    A couple of Rails Cheat Sheets -
    http://www.slash7.com/goodies
Rails Links
●
    Ruby - http://www.ruby-lang.org/en/
●
    Ruby on Rails - http://www.rubyonrails.org/
●
    Ruby Forge - http://rubyforge.org/
●
    Free Ruby manual - http://www.poignantguide.net/ruby/
●
    Rails and Caching -
    http://www.railsenvy.com/2007/2/28/rails-caching-tutorial
●
    Ruby On Rails to exe -
    http://www.erikveen.dds.nl/distributingrubyapplications/rails.html
●
    Rails Tricks -
    http://www.rubyinside.com/19-rails-tricks-most-rails-coders-dont-kno
●
    Rails Deployment -
    http://manuals.rubyonrails.com/read/book/17

Más contenido relacionado

La actualidad más candente

I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettextNgoc Dao
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAdler Hsieh
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled BundlerHiroshi SHIBATA
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to railsGo Asgard
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of RubyHiroshi SHIBATA
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard wayHiroshi SHIBATA
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard WayHiroshi SHIBATA
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smellolegshpynov
 
Zap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nkZap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nkPraveen Kumar
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonDomingo Suarez Torres
 
Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applicationsrailsconf
 
Ruby Isn't Just About Rails
Ruby Isn't Just About RailsRuby Isn't Just About Rails
Ruby Isn't Just About RailsAdam Wiggins
 

La actualidad más candente (19)

What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to rails
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
 
RubyMotion #jbday
RubyMotion #jbdayRubyMotion #jbday
RubyMotion #jbday
 
Rango
RangoRango
Rango
 
rsyslog meets docker
rsyslog meets dockerrsyslog meets docker
rsyslog meets docker
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard Way
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
WTF Is Rancher?
WTF Is Rancher?WTF Is Rancher?
WTF Is Rancher?
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Zap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nkZap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nk
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
 
Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applications
 
Ruby Isn't Just About Rails
Ruby Isn't Just About RailsRuby Isn't Just About Rails
Ruby Isn't Just About Rails
 
How to-node-core
How to-node-coreHow to-node-core
How to-node-core
 

Destacado (8)

Perl%20SYLLABUS%20PB
Perl%20SYLLABUS%20PBPerl%20SYLLABUS%20PB
Perl%20SYLLABUS%20PB
 
Tutorial
TutorialTutorial
Tutorial
 
instaling
instalinginstaling
instaling
 
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffersHow%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
 
11-DWR-and-JQuery
11-DWR-and-JQuery11-DWR-and-JQuery
11-DWR-and-JQuery
 
Sexism
SexismSexism
Sexism
 
Zaal 5 david terrar yes ive got
Zaal 5 david terrar yes ive gotZaal 5 david terrar yes ive got
Zaal 5 david terrar yes ive got
 
Jeni J2 Me Bab11 Topik Topik Tambahan
Jeni J2 Me Bab11 Topik Topik TambahanJeni J2 Me Bab11 Topik Topik Tambahan
Jeni J2 Me Bab11 Topik Topik Tambahan
 

Similar a rubyonrails

RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)scandiweb
 
SELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StorySELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StoryNathanial McConnell
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012Rafael Rosa
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi SHIBATA
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
Puppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven DevelopmentPuppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven DevelopmentPuppet
 
20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-parisJohan De Wit
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScriptJorg Janke
 
Writing a Ruby Gem for beginners
Writing a Ruby Gem for beginnersWriting a Ruby Gem for beginners
Writing a Ruby Gem for beginnersConFoo
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyHiroshi SHIBATA
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & CucumberUdaya Kiran
 
Ruby confhighlights
Ruby confhighlightsRuby confhighlights
Ruby confhighlightsClaire Tran
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First MileGourab Mitra
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Brian Sam-Bodden
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 

Similar a rubyonrails (20)

RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 
SELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StorySELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the Story
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Puppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven DevelopmentPuppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven Development
 
20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Writing a Ruby Gem for beginners
Writing a Ruby Gem for beginnersWriting a Ruby Gem for beginners
Writing a Ruby Gem for beginners
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
 
Ruby confhighlights
Ruby confhighlightsRuby confhighlights
Ruby confhighlights
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
 
Autolab Workshop
Autolab WorkshopAutolab Workshop
Autolab Workshop
 
Gems on Ruby
Gems on RubyGems on Ruby
Gems on Ruby
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 

Más de tutorialsruby

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

Más de tutorialsruby (20)

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Último

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Último (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

rubyonrails

  • 1. Ruby On Rails BeijingLUG by Nathaniel Brown April 2007
  • 2. Overview ● Install Ruby ● Install Rails ● (Optional) Install Eclipse ● Talk about Ruby ● Talk about Rails ● Example Application ● Links to Resources
  • 3. Install Ruby ● sudo apt-get install ruby irb ri rdoc ● If you want to install mongrel you will also have to install the dev packages. ● sudo apt-get install ruby1.8-dev build-essential
  • 4. Install Ruby Gems ● wget : http://rubyforge.org/frs/download.php/17190/ ● tar xzvf rubygems-0.9.2.tgz ● cd rubygems-0.9.2 ● sudo ruby setup.rb ● cd .. ● rm -rf rubygems-0.9.2
  • 5. Install Rails and Mongrel ● sudo gem install rails --include-dependencies ● (Optional) sudo gem install mongrel --include- dependencies ● (Optional) Select the latest version of each library.
  • 6. Install MySQL Server ● You could use PostgreSQL or SQLite instead but most examples use MySQL so we will as well. ● sudo apt-get install mysql-server phpmyadmin libmysql-ruby apache2 libapache2-mod-php5
  • 7. (Optional) Install Eclipse ● sudo apt-get install eclipse sun-java5-jdk sun- java5-fonts
  • 8. (Optional) Install RDT, RadRails and Aptana and Subclipse ● Open Eclipse and go to Help ->Software Updates -> Find and Install... ● Select “Search for new features to install” then click on “Next”. ● Add the following remote sites: RDT : http://updatesite.rubypeople.org/release RadRails : http://radrails.sourceforge.net/update Aptana : http://update.aptana.com/install/ Subclipse : http://subclipse.tigris.org/update_1.2.x ● Once they have been added install all of them.
  • 9. (Optional) Config RDT and RadRails ● Open Eclipse and go to Windows -> Preferences ● Find Ruby and add the Ruby interpreter. ● Find Rails and add the applications. They should all be in /usr/bin/*app name*
  • 10. Ruby is a nice language ● Object Orientated ● Automatic garbage collection ● Sane readable code that makes sense.
  • 11. Ruby example code 1 ● Is readable puts "leon".reverse.capitalize staff_list = ["joe", "steve", "bob"] staff_list.sort! staff_list.each do |first_name| puts first_name.capitalize end 3.times do |zork| puts "#{zork} " end
  • 12. Ruby example code 2 −Tells you if it will change the variable. my_string = "12345" new_string = my_string.chop puts "String chopped." puts "my_string: #{my_string}" puts "new_string: #{new_string}" my_string = "98765" puts "my_string: #{my_string}" my_string.chop! puts "String chopped." puts "my_string: #{my_string}" my_number = 999474 puts my_number.to_s.include?("94") my_string = "This is a test." puts "#{my_string[3..5]}" puts "#{my_string[2]}" my_string[10..13] = "Ruby" puts my_string
  • 13. Ruby example code 3 −Lots of things are just done really nicely. #create our thread array threads = [] 5.times do |i|   #create 5 threads into the array           threads[i] = Thread.new do     #wait a random amount of time, then print a message     sleep(rand(10))     puts "I am thread number #{i}"   end end #let each thread finish before ending the program threads.each {|t| t.join}
  • 14. Rails is a nice Framework ● Rapid Application Development ● Caching ● Model View Controller ● Nice informative errors ● DRY – Don't Repeat Yourself. ● Convention over Configuration
  • 15. Rails supports modern features ● AJAX is build into the framework but JavaScript isn't required. ● Pretty URLs ● Active Record which is a type of Object Relation Mapping (ORM)
  • 16. Rails encourages good development practices ● Validation ● Unit testing ● Use of development, testing and production environments with sane settings for each of them. e.g. Development has caching turned off. Production and Testing have it turned on. ● Version control is encouraged and assumed.
  • 17. The Bad ● No manual only books. ● Ruby is relatively slow. (See Language Shoot- out) ● Rails is database driven which means it scales with the database. ● You'll often have to do things the “Rails Way”. (But it's often the right way as well) ● Lots of the 3rd party libraries are still unstable. (Improving quickly)
  • 18. Create Your First Rails Applications ● If you are reading this online then go to the links section find RadRail's home page. He has a fairly good tutorial using RadRails.
  • 19. Resources Links ● Rails for Fedora - http://digitalmediaminute.com/howto/fc4rails/ ● RDT - http://rubyeclipse.sourceforge.net/ ● RadRails and Aptana - http://www.radrails.org/ ● Language Shoot-out - http://shootout.alioth.debian.org/
  • 20. Cheat Sheets Links ● Rails, CSS, Javascript, HTML, etc (A4) - http://www.ilovejackdaniels.com/ ● Nice Rails summary - http://www.blainekendall.com/index.php/rubyonrails ● A couple of Rails Cheat Sheets - http://www.slash7.com/goodies
  • 21. Rails Links ● Ruby - http://www.ruby-lang.org/en/ ● Ruby on Rails - http://www.rubyonrails.org/ ● Ruby Forge - http://rubyforge.org/ ● Free Ruby manual - http://www.poignantguide.net/ruby/ ● Rails and Caching - http://www.railsenvy.com/2007/2/28/rails-caching-tutorial ● Ruby On Rails to exe - http://www.erikveen.dds.nl/distributingrubyapplications/rails.html ● Rails Tricks - http://www.rubyinside.com/19-rails-tricks-most-rails-coders-dont-kno ● Rails Deployment - http://manuals.rubyonrails.com/read/book/17