Is 'require "rubygems" necessory?

I create a sample app in padrino. orm is sequel and db is sqlite3 as
default. When I rake sq:migrate:auto, it will failed because of database
is not loaded. So I run the irb, and in irb require 'sqlite3' failed.
But It will be ok if I require 'rubygems' before require 'sqlite3'. Is
'require "rubygems" necessory?

···

--
Posted via http://www.ruby-forum.com/.

I create a sample app in padrino. orm is sequel and db is sqlite3 as
default. When I rake sq:migrate:auto, it will failed because of database
is not loaded. So I run the irb, and in irb require 'sqlite3' failed.
But It will be ok if I require 'rubygems' before require 'sqlite3'. Is
'require "rubygems" necessory?

It is if you are using ruby 1.8.x. Since ruby 1.9 the gem directories are part
of the path by default, so it isn't needed any more.

Fela Winkelmolen wrote:

I create a sample app in padrino. orm is sequel and db is sqlite3 as
default. When I rake sq:migrate:auto, it will failed because of database
is not loaded. So I run the irb, and in irb require 'sqlite3' failed.
But It will be ok if I require 'rubygems' before require 'sqlite3'. Is
'require "rubygems" necessory?

It is if you are using ruby 1.8.x. Since ruby 1.9 the gem directories
are part
of the path by default, so it isn't needed any more.

You are right. All the gems include sequel and padrino is lastest except
the ruby is 1.8.7. Must I install the ruby 1.9 to develop padrino app?

gem env:
H:\study\fybjy\myoa>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
  - INSTALLATION DIRECTORY: H:/Ruby/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: H:/Ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: H:/Ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - H:/Ruby/lib/ruby/gems/1.8
     - C:/Users/limux/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--env-shebang"
     - :sources => ["http://rubygems.org"]
     - "update" => "--env-shebang"
  - REMOTE SOURCES:
     - http://rubygems.org

···

--
Posted via http://www.ruby-forum.com/\.

Fela Winkelmolen wrote:
  

I create a sample app in padrino. orm is sequel and db is sqlite3 as
default. When I rake sq:migrate:auto, it will failed because of database
is not loaded. So I run the irb, and in irb require 'sqlite3' failed.
But It will be ok if I require 'rubygems' before require 'sqlite3'. Is
'require "rubygems" necessory?
      

It is if you are using ruby 1.8.x. Since ruby 1.9 the gem directories
are part
of the path by default, so it isn't needed any more.
    

You are right. All the gems include sequel and padrino is lastest except
the ruby is 1.8.7. Must I install the ruby 1.9 to develop padrino app?
  

No, you just have to require rubygems before using them.

···

On 5/8/2010 9:19 AM, mengjiang Liu wrote:

gem env:
H:\study\fybjy\myoa>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
  - INSTALLATION DIRECTORY: H:/Ruby/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: H:/Ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: H:/Ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - H:/Ruby/lib/ruby/gems/1.8
     - C:/Users/limux/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--env-shebang"
     - :sources => ["http://rubygems.org"]
     - "update" => "--env-shebang"
  - REMOTE SOURCES:
     - http://rubygems.org

Have you ever use padrino? I find this issue after i do fellow it's tutorial.<br><br>在2010-05-08 23:55:14,"Walton Hoops" <walton@vyper.hopto.org> 写道:

···

On 5/8/2010 9:19 AM, mengjiang Liu wrote:

Fela Winkelmolen wrote:
  

I create a sample app in padrino. orm is sequel and db is sqlite3 as
default. When I rake sq:migrate:auto, it will failed because of database
is not loaded. So I run the irb, and in irb require 'sqlite3' failed.
But It will be ok if I require 'rubygems' before require 'sqlite3'. Is
'require "rubygems" necessory?
      

It is if you are using ruby 1.8.x. Since ruby 1.9 the gem directories
are part
of the path by default, so it isn't needed any more.
    

You are right. All the gems include sequel and padrino is lastest except
the ruby is 1.8.7. Must I install the ruby 1.9 to develop padrino app?
  

No, you just have to require rubygems before using them.

gem env:
H:\study\fybjy\myoa>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
  - INSTALLATION DIRECTORY: H:/Ruby/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: H:/Ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: H:/Ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - H:/Ruby/lib/ruby/gems/1.8
     - C:/Users/limux/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--env-shebang"
     - :sources => ["http://rubygems.org"]
     - "update" => "--env-shebang"
  - REMOTE SOURCES:
     - http://rubygems.org