No it’s for your production mode. Because with the production
database, there are too production configuration about cache by
example. So it’s advise to use production environnement for a blog not
use for developpement.
The command below should generate the development database, isn’t it ?
This commande create the database. But your user are right for create it
?
No it’s for your production mode. Because with the production
database, there are too production configuration about cache by
example. So it’s advise to use production environnement for a blog not
use for developpement.
Ok, I was trying it on my local so thought of trying the development
mode to begin with.
Even with production mode, I’m getting:
– cut here –
(in /Users/arungupta/samples/jruby/typo-5.0.3)
rake aborted! #42000Unknown database ‘typo’
(See full trace by running task with --trace)
– cut here –
The command below should generate the development database, isn’t it ?
This commande create the database. But your user are right for create it ?
I’m using the database.yml bundled with Typo 5.0.3 and MySQL is also
default (username: root, password: ).
Which Adapter are you using SQLite3? MySQL?
MySQL with JRuby
With JRuby, I think that the Mysql adapter doesn’t work. You need use
: jdbcmysql
Test with change the line adapter : mysql by adapter : jdbcmysql
and install the gems jdbc-mysql activerecord-jdbcmysql-adapter.
MySQL Ruby adapter has always worked for me on Mac OS X.
As I said above,
~/testbed/jruby-1.1.2/bin/jruby -S rails foo -d mysql
cd foo
~/testbed/jruby-1.1.2/bin/jruby -S rake db:create
creates foo_development database for me. Why do I have to create it
explicitly for Typo ?
AIU the main point of db:create is to create the database. Since Rails
2.0, I’ve never use mysqladmin command to create the database and
always used db:create. I’m still confused why I need to explicitly
create the database using mysqladmin.
-Arun
Hi Arun,
No one here believes you? Well I do… had the same error. I found
several URLs of the same sort, like
and this very recent bug report: http://rails.lighthouseapp.com/projects/8994/tickets/63-bug-rake-db-create-and-observers
However, I ended up giving up on rails and created my database manually.
It IS a bug in rails, maybe triggered by one of the plugins, who knows.
Since it only shows up at db creation time I thought it not worth
investigating further.
To all those doubters here, first, db:create IS supposed to create the
database. When I run it and the (empty!) schema exists it complains
about this fact. When the schema doesn’t exist I get the same error as
Arun. It’s just another bug in rails.
then you can try rake db:create
I know mysqladmin command.
AIU the main point of db:create is to create the database. Since Rails
2.0, I’ve never use mysqladmin command to create the database and
always used db:create. I’m still confused why I need to explicitly
create the database using mysqladmin.
-Arun
It is the one bundled with Typoe 5.0.3 and shown here:
<<: *login
Which Adapter are you using SQLite3? MySQL?
~/testbed/jruby-1.1.2/bin/jruby -S rails foo -d mysql
–
Web Technologies and Standards
Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta
Since Rails 2.0 (now 2.1), I’ve always created database using
db:create. I was wondering why it just does not work with Typo but the
bug report seems to make some sense. Now the weird thing is that
config/environment.rb has:
It wasn’t that I had any doubt that db:create should work, it was that
rake task is defined in rails, and not typo. So I felt it was more
rails related. Where it’s casued or ended, I don’t know.
it works for me with regular ruby 1.8.6, I don’t use jruby so I did
not test, but I assume that jruby is unrelated.
Unfortunately, I am a believer in testing w/ ruby only, as I have
found some unique problems using rubinus, YARV and jruby that do not
happen elsewhere…
When in doubt, try it the “normal” way, and if it works, backtrack and
find out where and why it’s failing.
… however for me personally I try to run a secure MySQL Server; so I
give each rails app it’s own login credentials, and db:create will/
would fail because I do not give it permission to create a database.
Which is why I find db:create rake task to be downright silly.
i’m having the same problem since yesterday, whin i updated
to 2.1.0. for me the problem is that this new version of
rake is loading the files in my ‘config/initializers’ directory,
and one of the files has database operations, so as the database
is not created yet the ‘db:create’ task halts. i commented
the db calls and the db was created normally.
anyone knows how to avoid this loading? or why rake
is now loading the appl context?
Hi. I just have the same problem yesterday.
Here is my notes so far:
Solving rake db:migrate error
Error:
$ rake db:migrate
(in /Users/johndoe/Sites/MyProject)
rake aborted! #42000Unknown database ‘myDB’
/Users/johndoe/Sites/MyProject/rakefile:10
(See full trace by running task with --trace)
Solution:
Open config/application.rb
Comment all block related to
if ActiveRecord::Base.connection.tables.include?(“countries”)
I’m trying to install Typo 5.0.3 and “rake db:create” gives the
following error:
– cut here –
(in /Users/arungupta/samples/jruby/typo-5.0.3)
rake aborted! #42000Unknown database ‘typo_dev’
I am new to Rails and Ruby and I’ve had a similar problem with a remote
copy of mysql running on a non-dns server on my internal home network.
192.168.0.101 is my Win7 Ruby development environment and a mysql server
is running on 192.168.0.103 on a FreeBSD machine.
I have the following settings in database.yml:
development:
adapter: mysql
encoding: utf8
reconnect: false
database: myapp_development
pool: 5
username: mysql
host: !str “192.168.0.103”
password:
port: 3306
I had a number of problems connecting to mysql when both were installed
on Win7,
in fact so many that I moved the server to UNIX. Using SQLite works
fine, but
I wanted to try MySQL.
The first problem I had connecting was the IP address not being picked
up by
the YAML configuration file. After hours of haggling with various
things, I
found [!str “192.168.0.103”] works in converting the IP address to a
proper
string.
The second problem I had was in thinking “rake db:migrate” would create
the
database for me. But reading advice in this forum, I created it manually
and
that seemed to do the trick. Tables got created in it.
Most people here probably already know this stuff but I thought I would
post my
experience anyway since it has been an all-day affair to fix.
I’m trying to install Typo 5.0.3 and “rake db:create” gives the
following error:
– cut here –
(in /Users/arungupta/samples/jruby/typo-5.0.3)
rake aborted! #42000Unknown database ‘typo_dev’
I am new to Rails and Ruby and I’ve had a similar problem with a remote
copy of mysql running on a non-dns server on my internal home network.
192.168.0.101 is my Win7 Ruby development environment and a mysql server
is running on 192.168.0.103 on a FreeBSD machine.
I have the following settings in database.yml:
development:
adapter: mysql
encoding: utf8
Oh, one more thing. To get the connections going I had to download an
older version of libmySQL.dll from Oracle’s website and installed it in
the /bin directory of my Ruby installation. The dll was version 5.1.x
and the server is also 5.1.x and I think that solved the connection
problem.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.