Ruby on rails on linux (ubuntu) want my mysql password but

Hi everyone!

I work since yesterday on that:

I am running the newest ubuntu version (6.1 or so). and i installed the
mysql server with

apt-get install mysql-server

or something like that.

My mysql server works fine, and i can access it also with phpmyadmin or
other mysql tools.

I have installed ruby on rails and have started creating a project:

rails testapplication

That was successfull and I edited the database.yml file and setted up my
database info (database already existing in mysql).

When I now start WEBrick and pointing my browser to localhost:3000, I
get the nice start page… (welcome abroad) but there is also a “Rails
needs to know your login and password.” on that.

?!?

I have also built a test.rb file, which can connect to mysql and puts
out the current mysql server version…

What’s wrong? Anybody got ideas?

Thanks! :frowning:

You’ve got to delete that file (as it says on that page) to see your
rails
application. Delete public/index.html, and create a controller/scaffold
or
two, and set up the routes.rb well. Following a tutorial somewhere would
help.

Vish

Hi Markus,

Markus Z. wrote:

When I now start WEBrick and pointing my browser to localhost:3000, I
Thanks! :frowning:

Have you installed the libmysql-ruby pacakge?

sudo apt-get install libmysql-ruby

Cheers,

Tim

Vishnu G. wrote:

You’ve got to delete that file (as it says on that page) to see your
rails
application. Delete public/index.html, and create a controller/scaffold
or
two, and set up the routes.rb well. Following a tutorial somewhere would
help.

Vish

nope… i can not create a controller… rails says that it can not
connect to the mysql server. I now believe that my mysql server not
accepts any TCP connections from ruby (same also in phpmyadmin:
phpmyadmin only connects via unix sockets, either i defined in
phpmyadmin’s config.inc.php to connect over tcp or sockets…)

Tim Littlemore wrote:

Hi Markus,

Markus Z. wrote:

When I now start WEBrick and pointing my browser to localhost:3000, I
Thanks! :frowning:

Have you installed the libmysql-ruby pacakge?

sudo apt-get install libmysql-ruby

Cheers,

Tim

Hi Tim

Yeah, I have installed libmysql-ruby…

:frowning:

kind regards
mzuercher

Here my databases.yml:

development:
adapter: mysql
database: testapp_development
username: root
password: pwd
host: localhost

test:
adapter: mysql
database: testapp_development
username: root
password: pwd
host: localhost

production:
adapter: mysql
database: testapp_development
username: root
password: pwd
host: localhost

For testing, I have used the root account…

Christophe M. wrote:

have you tried adding a socket line?

development:
adapter: mysql
database: testapp_development
username: root
password: pwd
host: localhost
socket: /var/run/mysqld/mysqld.sock

ubuntu does not have this in the place rails assumes.

regards,
_c

Hi Christophe

Not tried yet. But thank you, I have looked where my mysql socket is
(also /var/run/mysqld/mysqld.sock), changed the database.yml as you said
and saved it… Then, i did a restart of both mysql server and WEBrick…

still the same problem.

regardas
mzuercher

hey i don’t think i have libmysql-ruby installed at all, either through
atp or gems. does rails have the functionality built in, because rails
works fine on my system?

anyway, humor me and try uninstalling mysql-ruby, and also double check
you don’t have it installed twice through gems and atp. have no idea if
it will work but give it a shot.

_c

have you tried adding a socket line?

development:
adapter: mysql
database: testapp_development
username: root
password: pwd
host: localhost
socket: /var/run/mysqld/mysqld.sock

ubuntu does not have this in the place rails assumes.

regards,
_c

atp or gems.

i meant apt of course

Christophe M. wrote:

atp or gems.

i meant apt of course

It doesn’t work… Aaaah! my nerves! I spent hours fixing that, I
deinstalled mysql and rails over 10 times and re-installed it…

On windows, I have no problems to work with rails, but, who really wants
Windows? ^^

Markus Z. wrote:

Christophe M. wrote:

atp or gems.

i meant apt of course

It doesn’t work… Aaaah! my nerves! I spent hours fixing that, I
deinstalled mysql and rails over 10 times and re-installed it…

On windows, I have no problems to work with rails, but, who really wants
Windows? ^^

I have completely uninstalled my ubuntu now… but it doesnt work
already… WHO CAN HELP PLS!!! :frowning: