Im very new and having trouble

HI,

I started Ruby on rails a couple of days ago and have been having a
problem. Whenever I startup webrick server and goto 0.0.0.0:3000 (When
i start the server in my terminal it says this

"Booting WEBrick
=> Rails 3.0.9 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-07-19 11:17:11] INFO WEBrick 1.3.1
[2011-07-19 11:17:11] INFO ruby 1.8.7 (2009-06-12) [universal-
darwin10.0]
[2011-07-19 11:17:11] INFO WEBrick::HTTPServer#start: pid=325
port=3000
"
in the browser my rails project comes up and when I click on “About
your applications environment” it says

“Please install the mysql2 adapter: gem install activerecord-mysql2- adapter (no such file to load – active_record/connection_adapters/
mysql2_adapter)”

and i have tried this and researched it for many hours!

EXTRA INFORMATION:

when i end the webrick server this is what is said

"DEPRECATION WARNING: config.action_view.debug_rjs will be removed in
3.1, from 3.1 onwards you will need to install prototype-rails to
continue to use RJS templates . (called from /Library/Ruby/Gems/1.8/
gems/railties-3.0.9/lib/rails/engine.rb:192)

Started GET “/rails/info/properties” for 127.0.0.1 at Tue Jul 19
11:18:43 +0200 2011

RuntimeError (Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (no such file to load – active_record/
connection_adapters/mysql2_adapter)):

Rendered /Users/robertbodley/.gem/ruby/1.8/gems/actionpack-3.0.9/lib/
action_dispatch/middleware/templates/rescues/_trace.erb (0.6ms)
Rendered /Users/robertbodley/.gem/ruby/1.8/gems/actionpack-3.0.9/lib/
action_dispatch/middleware/templates/rescues/_request_and_response.erb
(15.7ms)
Rendered /Users/robertbodley/.gem/ruby/1.8/gems/actionpack-3.0.9/lib/
action_dispatch/middleware/templates/rescues/diagnostics.erb within
rescues/layout (19.5ms)
^C[2011-07-19 11:20:58] INFO going to shutdown …
[2011-07-19 11:20:58] INFO WEBrick::HTTPServer#start done.
Exiting"

my gem list is:

"gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.9)
actionpack (3.0.9)
activemodel (3.0.9)
activerecord (3.0.9 ruby)
activerecord-jdbc-adapter (1.1.2)
activerecord-jdbcmysql-adapter (1.1.2)
activeresource (3.0.9)
activesupport (3.0.9)
arel (2.1.3, 2.0.10)
builder (3.0.0, 2.1.2)
bundler (1.0.15)
erubis (2.6.6)
i18n (0.5.0)
jdbc-mysql (5.1.13)
mail (2.2.19)
mime-types (1.16)
mysql (2.8.1)
mysql2 (0.3.6, 0.2.11)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.9)
railties (3.0.9)
rake (0.9.2)
rdoc (3.8, 3.7, 3.6.1)
rubygems-update (1.8.5)
sqlite3 (1.3.3)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.29, 0.3.28)"

I am using “mysql2”

if you would need anymore information. Please would you ask

Thanks you
Robert

Well, what happens when you try to install the
activerecord-mysql2-adapter
like it suggests?

gem install activerecord-mysql2-adapter

Just add : gem ‘mysql2’, ‘< 0.3’

in you Gemfile and then bundle update!!

On Tue, Jul 19, 2011 at 2:54 PM, Robert Bodley
[email protected]wrote:

[2011-07-19 11:17:11] INFO WEBrick 1.3.1
mysql2_adapter)"
gems/railties-3.0.9/lib/rails/engine.rb:192)
Rendered /Users/robertbodley/.gem/ruby/1.8/gems/actionpack-3.0.9/lib/

activerecord (3.0.9 ruby)
mail (2.2.19)
rdoc (3.8, 3.7, 3.6.1)
Thanks you

Please consider the environment before printing this email.

Regards,
Surya

It says

"gem install activerecord-mysql2-adapter
ERROR: Could not find a valid gem ‘activerecord-mysql2-adapter’ (>=
0) in any repository
ERROR: Possible alternatives: activerecord-jdbcmysql-adapter,
activerecord-jdbch2-adapter, activerecord-jdbc-adapter, activerecord-
jdbcmssql-adapter, activerecord-nulldb-adapter
"

how would I add gem ‘mysql2’, ‘< 0.3’

sorry I am very new and thanks for the help!

Robert Bodley wrote in post #1011620:

how would I add gem ‘mysql2’, ‘< 0.3’

sorry I am very new and thanks for the help!

Open the “Gemfile” in your project root directory and type the line
above in there.
Then run “bundle install” from the command line.

what does your config/database.yml file look like?
make sure under development it has
adapter: mysql2

I did that and my gemfile looks like this

"source ‘http://rubygems.org

gem ‘rails’, ‘3.0.9’

Bundle edge Rails instead:

gem ‘rails’, :git => ‘git://github.com/rails/rails.git’

gem ‘mysql2’, ‘< 0.3’

Use unicorn as the web server

gem ‘unicorn’

Deploy with Capistrano

gem ‘capistrano’

To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby

1.9.2+)

gem ‘ruby-debug’

gem ‘ruby-debug19’, :require => ‘ruby-debug’

Bundle the extra gems:

gem ‘bj’

gem ‘nokogiri’

gem ‘sqlite3-ruby’, :require => ‘sqlite3’

gem ‘aws-s3’, :require => ‘aws/s3’

Bundle gems for the local environment. Make sure to

put test-only gems in this group so their generators

and rake tasks are available in development mode:

group :development, :test do

gem ‘webrat’

end

"

Robert-Bodleys-iMac:~ robertbodley$ cd Sites/simple_cms/
Robert-Bodleys-iMac:simple_cms robertbodley$ bundle install
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.3)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.29)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using bundler (1.0.15)
Using mysql2 (0.2.11)
Using rdoc (3.8)
Using thor (0.14.6)
Using railties (3.0.9)
Using rails (3.0.9)
Your bundle is complete! Use bundle show [gemname] to see where a
bundled gem is installed.

When i started webrick this happened
"
Robert-Bodleys-iMac:simple_cms robertbodley$ rails s
=> Booting WEBrick
=> Rails 3.0.9 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-07-19 14:52:56] INFO WEBrick 1.3.1
[2011-07-19 14:52:56] INFO ruby 1.8.7 (2009-06-12) [universal-
darwin10.0]
[2011-07-19 14:53:26] INFO WEBrick::HTTPServer#start: pid=1159
port=3000
"

and when i ended this happeded
"DEPRECATION WARNING: config.action_view.debug_rjs will be removed in
3.1, from 3.1 onwards you will need to install prototype-rails to
continue to use RJS templates . (called from /Library/Ruby/Gems/1.8/
gems/railties-3.0.9/lib/rails/engine.rb:192)
"

And i still get the error :frowning:

Then i ended the server and this happened in terminal

"

and when I did the bundle install this happened

This is what it looks like

MySQL. Versions 4.1 and 5.0 are recommended.

Install the MySQL driver:

gem install mysql2

And be sure to use new-style password hashing:

http://dev.mysql.com/doc/refman/5.0/en/old-client.html

development:
adapter: mysql2
encoding: utf8
reconnect: false
database: simple_cms_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock

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: mysql2
encoding: utf8
reconnect: false
database: simple_cms_test
pool: 5
username: root
password:
socket: /tmp/mysql.sock

production:
adapter: mysql2
encoding: utf8
reconnect: false
database: simple_cms_production
pool: 5
username: root
password:
socket: /tmp/mysql.sock

I Have dont all of that already any other suggestions?

Hi,

 "DEPRECATION WARNING" isn't an error, it's just a warning before

you upgrade to the next version… so the problem is somewhere else.

 Starting from zero... I'll suggest:
 1. Have you created the database in the MySQL? As far as I remember

the magic of rails doesn’t create the database from zero.
2. Can you access the database with the same user/password and
execute some select to your tables?
3. If you have change / migrate from sqlLite to Mysql, after
creating the database you need to run again “rake db:migrate” in ordre
to recreate the table and “rake db:seed” in order to add the default
content.

 I hope it will help you.

El 19/07/2011 16:21, Robert Bodley escribi:

adapter: mysql2

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

production:
On Jul 19, 3:50 pm, Juan Alvarado[email protected] wrote:

gem ‘capistrano’

put test-only gems in this group so their generators

Using builder (2.1.2)
Using treetop (1.4.9)
Using rails (3.0.9)
[2011-07-19 14:52:56] INFO ruby 1.8.7 (2009-06-12) [universal-
And i still get the error :frowning:


Posted viahttp://www.ruby-forum.com/.

You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]

For more options, visit this group
athttp://groups.google.com/group/rubyonrails-talk?hl=en.


Miquel C. Escarr
+34 699 73 22 46
[email protected]

“Computers are good at following instructions, but not at reading your
mind.” Donald Knuth.

“Los ordenadores son buenos siguiendo instrucciones, pero no leyendo tu
mente.” Donald Knuth.

yes, but im trying to follow the Lynda.com tutorial

Since you’ve been working on this issue for like 3 hours with no
result and what you are trying to do is learn rails, not how and why
about the database, I would just recreate the project using the
default database, which is sqlite and get up and going.