# Warning: require\_gem is obsolete

**URL:** <https://www.ruby-forum.com/t/warning-require-gem-is-obsolete/120845>\
**Category:** Rails\
**Created:** [November 21, 2007, 1:58am UTC](https://www.ruby-forum.com/t/warning-require-gem-is-obsolete/120845 "2007-11-21T01:58:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [November 21, 2007, 1:58am UTC](https://www.ruby-forum.com/t/warning-require-gem-is-obsolete/120845/1 "2007-11-21T01:58:29Z")

</div>

I’m going to continue poking at rails – it’s very exciting 🙂

However, I’m a bit concerned about the warnings about obsolete gems  
usage. How can I update rails?

Googling indicates to re-install all gems, or grep for old code and  
manually replace. Is there a single command to do that?

thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $ rails dummy  
create  
create app/controllers  
create app/helpers  
create app/models  
create app/views/layouts  
create config/environments  
create components  
create db  
create doc  
create lib  
create lib/tasks  
create log  
create public/images  
create public/javascripts  
create public/stylesheets  
create script/performance  
create script/process  
create test/fixtures  
create test/functional  
create test/integration  
create test/mocks/development  
create test/mocks/test  
create test/unit  
create vendor  
create vendor/plugins  
create tmp/sessions  
create tmp/sockets  
create tmp/cache  
create Rakefile  
create README  
create app/controllers/application.rb  
create app/helpers/application\_helper.rb  
create test/test\_helper.rb  
create config/database.yml  
create config/routes.rb  
create public/.htaccess  
create config/boot.rb  
create config/environment.rb  
create config/environments/production.rb  
create config/environments/development.rb  
create config/environments/test.rb  
create script/about  
create script/breakpointer  
create script/console  
create script/destroy  
create script/generate  
create script/performance/benchmarker  
create script/performance/profiler  
create script/process/reaper  
create script/process/spawner  
create script/runner  
create script/server  
create script/plugin  
create public/dispatch.rb  
create public/dispatch.cgi  
create public/dispatch.fcgi  
create public/404.html  
create public/500.html  
create public/index.html  
create public/favicon.ico  
create public/robots.txt  
create public/images/rails.png  
create public/javascripts/prototype.js  
create public/javascripts/effects.js  
create public/javascripts/dragdrop.js  
create public/javascripts/controls.js  
create public/javascripts/application.js  
create doc/README\_FOR\_APP  
create log/server.log  
create log/production.log  
create log/development.log  
create log/test.log  
thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $ ruby /home/thufir/rubyCode/dummy/script/  
generate  
/home/thufir/rubyCode/dummy/script/…/config/boot.rb:28:Warning:  
require\_gem is obsolete. Use gem instead.  
Usage: /home/thufir/rubyCode/dummy/script/generate generator [options]  
[args]

General Options:  
-p, --pretend Run but do not make any changes.  
-f, --force Overwrite files that already exist.  
-s, --skip Skip files that already exist.  
-q, --quiet Suppress normal output.  
-t, --backtrace Debugging: show backtrace on  
errors.  
-h, --help Show this help message.  
-c, --svn Modify files with subversion.  
(Note:  
svn must be in path)

Installed Generators  
Builtin: controller, integration\_test, mailer, migration, model,  
plugin, scaffold, session\_migration, web\_service

More are available at [http://rubyonrails.org/show/Generators](http://rubyonrails.org/show/Generators)

1. Download, for example, login\_generator.zip
2. Unzip to directory /home/thufir/.rails/generators/login  
to use the generator with all your Rails apps  
or to /home/thufir/rubyCode/dummy/generators/login  
to use with this app only.
3. Run generate with no arguments for usage information  
/home/thufir/rubyCode/dummy/script/generate login

Generator gems are also available:

1. gem search -r generator
2. gem install login\_generator
3. /home/thufir/rubyCode/dummy/script/generate login

thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $ mysql --user=root  
Welcome to the MySQL monitor. Commands end with ; or \g.  
Your MySQL connection id is 4  
Server version: 5.0.44-log Gentoo Linux mysql-5.0.44

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql\>  
mysql\> show databases;  
±-------------------+  
| Database |  
±-------------------+  
| information\_schema |  
| dummy\_development |  
| dummy\_production |  
| dummy\_test |  
| feed\_on\_feeds |  
| mysql |  
| test |  
±-------------------+  
7 rows in set (0.12 sec)

mysql\>  
mysql\> use dummy\_development;  
Database changed  
mysql\>  
mysql\> describe dummy\_development;  
ERROR 1146 (42S02): Table ‘dummy\_development.dummy\_development’ doesn’t  
exist  
mysql\>  
mysql\> show tables;  
Empty set (0.00 sec)

mysql\>  
mysql\> quit  
Bye  
thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $ cat /home/thufir/rubyCode/dummy/config/  
database.yml

# MySQL (default setup). Versions 4.1 and 5.0 are recommended.

# 

# Install the MySQL driver:

# gem install mysql

# On MacOS X:

# gem install mysql – --include=/usr/local/lib

# On Windows:

# There is no gem for Windows. Install mysql.so from RubyForApache.

# [http://rubyforge.org/projects/rubyforapache](http://rubyforge.org/projects/rubyforapache)

# 

# And be sure to use new-style password hashing:

# [http://dev.mysql.com/doc/refman/5.0/en/old-client.html](http://dev.mysql.com/doc/refman/5.0/en/old-client.html)

development:  
adapter: mysql  
database: dummy\_development  
username: root  
password:  
host: localhost

# Warning: The database defined as ‘test’ will be erased and

# re-generated from your development database when you run ‘rake’.

# Do not set this db to the same as development or production.

test:  
adapter: mysql  
database: dummy\_test  
username: root  
password:  
host: localhost

production:  
adapter: mysql  
database: dummy\_production  
username: root  
password:  
host: localhost  
thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $ ruby dummy/script/server  
./dummy/script/…/config/boot.rb:28:Warning: require\_gem is obsolete.  
Use gem instead.  
=\> Booting WEBrick…  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2007-11-20 16:45:36] INFO WEBrick 1.3.1  
[2007-11-20 16:45:36] INFO ruby 1.8.5 (2006-12-04) [i686-linux]  
[2007-11-20 16:45:36] INFO WEBrick::HTTPServer#start: pid=8001  
port=3000  
127.0.0.1 - - [20/Nov/2007:16:45:45 PST] “GET / HTTP/1.1” 200 7552

- → /  
127.0.0.1 - - [20/Nov/2007:16:45:45 PST] “GET /javascripts/prototype.js  
HTTP/1.1” 200 55149  
[http://localhost:3000/](http://localhost:3000/) → /javascripts/prototype.js  
127.0.0.1 - - [20/Nov/2007:16:45:45 PST] “GET /javascripts/effects.js  
HTTP/1.1” 200 32871  
[http://localhost:3000/](http://localhost:3000/) → /javascripts/effects.js  
127.0.0.1 - - [20/Nov/2007:16:45:46 PST] “GET /images/rails.png  
HTTP/1.1”  
200 1787  
[http://localhost:3000/](http://localhost:3000/) → /images/rails.png  
127.0.0.1 - - [20/Nov/2007:16:45:48 PST] “GET /rails/info/properties  
HTTP/1.1” 500 60  
[http://localhost:3000/](http://localhost:3000/) → /rails/info/properties  
[2007-11-20 16:45:55] INFO going to shutdown …  
[2007-11-20 16:45:55] INFO WEBrick::HTTPServer#start done.  
thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $ cat /etc/gentoo-release  
Gentoo Base System release 1.12.9  
thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $ date  
Tue Nov 20 16:46:02 PST 2007  
thufir@arrakis ~/rubyCode $  
thufir@arrakis ~/rubyCode $

thanks,

Thufir

---

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [November 21, 2007, 5:25am UTC](https://www.ruby-forum.com/t/warning-require-gem-is-obsolete/120845/2 "2007-11-21T05:25:24Z")

</div>

thufir@arrakis ~ $ gem update rails --include-dependencies

change config/boot.rb line 28 to gem … instead of require\_gem.

---

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [November 21, 2007, 10:10pm UTC](https://www.ruby-forum.com/t/warning-require-gem-is-obsolete/120845/3 "2007-11-21T22:10:11Z")

</div>

On Nov 20, 8:23 pm, Ryan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> thufir@arrakis ~ $ gem update rails --include-dependencies
> 
> change config/boot.rb line 28 to gem … instead of require\_gem.  
> […]

I might end up doing that, thank you 🙂

-Thufir
