Hello All,
Yesterday i put RoR with Locomotive. I am very happy :p.
So I follow this tuto
(http://developer.apple.com/tools/rubyonrails.html). I used Sqlite.
my database.yml
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
#
# Get the fast C bindings:
# gem install mysql
# (on OS X: gem install mysql -- --include=/usr/local/lib)
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: sqlite
dbfile: db/expense_developement
# Connect on a TCP socket. If omitted, the adapter will connect on the
# domain socket given by socket instead.
#host: localhost
#port: 3306
# 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: expenses_test
username: root
password:
socket: /tmp/mysql.sock
production:
adapter: mysql
database: expenses_production
username: root
password:
socket: /tmp/mysql.sock
# PostgreSQL versions 7.4 - 8.1
#
# Get the C bindings:
# gem install postgres
# or use the pure-Ruby bindings on Windows:
# gem install postgres-pr
postgresql_example:
adapter: postgresql
database: expenses_development
username: expenses
password:
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn''t need configuration.
#host: remote-database
#port: 5432
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
# Character set encoding. The server defaults to sql_ascii.
#encoding: UTF8
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# info, notice, warning, error, log, fatal, or panic
# The server defaults to notice.
#min_messages: warning
# SQLite version 2.x
# gem install sqlite-ruby
sqlite_example:
adapter: sqlite
database: db/development.sqlite2
# SQLite version 3.x
# gem install sqlite3-ruby
sqlite3_example:
adapter: sqlite3
database: db/development.sqlite3
# In-memory SQLite 3 database. Useful for tests.
sqlite3_in_memory_example:
adapter: sqlite3
database: ":memory:"
When i tabe this line in Terminal
$ script/generate Model Expense
I show only that
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/expense.rb
create test/unit/expense_test.rb
create test/fixtures/expenses.yml
i didn''t see this commands
create db/migrate
create db/migrate/001_create_expenses.rb
I don''t have this folder and this file
Thanks
Bolo
i think i had a similar problem. if you are using sqlite3 on your system then you''ll want to use the sqlite3 adapter, not the sqlite adapter. give that a shot and see if it does anything. I could be way off base. On 3/31/06, Bolo Michelin <malavoi@gmail.com> wrote:> > Hello All, > > Yesterday i put RoR with Locomotive. I am very happy :p. > So I follow this tuto > (http://developer.apple.com/tools/rubyonrails.html). I used Sqlite. > > my database.yml > # MySQL (default setup). Versions 4.1 and 5.0 are recommended. > # > # Get the fast C bindings: > # gem install mysql > # (on OS X: gem install mysql -- --include=/usr/local/lib) > # And be sure to use new-style password hashing: > # http://dev.mysql.com/doc/refman/5.0/en/old-client.html > development: > adapter: sqlite > dbfile: db/expense_developement > > # Connect on a TCP socket. If omitted, the adapter will connect on the > # domain socket given by socket instead. > #host: localhost > #port: 3306 > > # 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: expenses_test > username: root > password: > socket: /tmp/mysql.sock > > production: > adapter: mysql > database: expenses_production > username: root > password: > socket: /tmp/mysql.sock > > > # PostgreSQL versions 7.4 - 8.1 > # > # Get the C bindings: > # gem install postgres > # or use the pure-Ruby bindings on Windows: > # gem install postgres-pr > postgresql_example: > adapter: postgresql > database: expenses_development > username: expenses > password: > > # Connect on a TCP socket. Omitted by default since the client uses a > # domain socket that doesn''t need configuration. > #host: remote-database > #port: 5432 > > # Schema search path. The server defaults to $user,public > #schema_search_path: myapp,sharedapp,public > > # Character set encoding. The server defaults to sql_ascii. > #encoding: UTF8 > > # Minimum log levels, in increasing order: > # debug5, debug4, debug3, debug2, debug1, > # info, notice, warning, error, log, fatal, or panic > # The server defaults to notice. > #min_messages: warning > > > # SQLite version 2.x > # gem install sqlite-ruby > sqlite_example: > adapter: sqlite > database: db/development.sqlite2 > > > # SQLite version 3.x > # gem install sqlite3-ruby > sqlite3_example: > adapter: sqlite3 > database: db/development.sqlite3 > > > # In-memory SQLite 3 database. Useful for tests. > sqlite3_in_memory_example: > adapter: sqlite3 > database: ":memory:" > > When i tabe this line in Terminal > $ script/generate Model Expense > > I show only that > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/expense.rb > create test/unit/expense_test.rb > create test/fixtures/expenses.yml > > i didn''t see this commands > create db/migrate > create db/migrate/001_create_expenses.rb > > I don''t have this folder and this file > > > Thanks > > Bolo > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060331/103b811b/attachment.html
Yup, that''s right - if it''s actually sqlite3, then you should use adapter:sqlite3 On 31/03/06, Chris Hall <christopher.k.hall@gmail.com> wrote:> > i think i had a similar problem. if you are using sqlite3 on your system > then you''ll want to use the sqlite3 adapter, not the sqlite adapter. > > give that a shot and see if it does anything. I could be way off base. > > > On 3/31/06, Bolo Michelin <malavoi@gmail.com> wrote: > > > > Hello All, > > > > Yesterday i put RoR with Locomotive. I am very happy :p. > > So I follow this tuto > > (http://developer.apple.com/tools/rubyonrails.html). I used Sqlite. > > > > my database.yml > > # MySQL (default setup). Versions 4.1 and 5.0 are recommended. > > # > > # Get the fast C bindings: > > # gem install mysql > > # (on OS X: gem install mysql -- --include=/usr/local/lib) > > # And be sure to use new-style password hashing: > > # http://dev.mysql.com/doc/refman/5.0/en/old-client.html > > development: > > adapter: sqlite > > dbfile: db/expense_developement > > > > # Connect on a TCP socket. If omitted, the adapter will connect on > > the > > # domain socket given by socket instead. > > #host: localhost > > #port: 3306 > > > > # 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: expenses_test > > username: root > > password: > > socket: /tmp/mysql.sock > > > > production: > > adapter: mysql > > database: expenses_production > > username: root > > password: > > socket: /tmp/mysql.sock > > > > > > # PostgreSQL versions 7.4 - 8.1 > > # > > # Get the C bindings: > > # gem install postgres > > # or use the pure-Ruby bindings on Windows: > > # gem install postgres-pr > > postgresql_example: > > adapter: postgresql > > database: expenses_development > > username: expenses > > password: > > > > # Connect on a TCP socket. Omitted by default since the client uses a > > > > # domain socket that doesn''t need configuration. > > #host: remote-database > > #port: 5432 > > > > # Schema search path. The server defaults to $user,public > > #schema_search_path: myapp,sharedapp,public > > > > # Character set encoding. The server defaults to sql_ascii. > > #encoding: UTF8 > > > > # Minimum log levels, in increasing order: > > # debug5, debug4, debug3, debug2, debug1, > > # info, notice, warning, error, log, fatal, or panic > > # The server defaults to notice. > > #min_messages: warning > > > > > > # SQLite version 2.x > > # gem install sqlite-ruby > > sqlite_example: > > adapter: sqlite > > database: db/development.sqlite2 > > > > > > # SQLite version 3.x > > # gem install sqlite3-ruby > > sqlite3_example: > > adapter: sqlite3 > > database: db/development.sqlite3 > > > > > > # In-memory SQLite 3 database. Useful for tests. > > sqlite3_in_memory_example: > > adapter: sqlite3 > > database: ":memory:" > > > > When i tabe this line in Terminal > > $ script/generate Model Expense > > > > I show only that > > exists app/models/ > > exists test/unit/ > > exists test/fixtures/ > > create app/models/expense.rb > > create test/unit/expense_test.rb > > create test/fixtures/expenses.yml > > > > i didn''t see this commands > > create db/migrate > > create db/migrate/001_create_expenses.rb > > > > I don''t have this folder and this file > > > > > > Thanks > > > > Bolo > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060331/a3e50231/attachment.html
So i must change my database.yml like that development: adapter: sqlite3 dbfile: db/expense_developement 2006/3/31, Tom Armitage <tom.armitage@gmail.com>:> Yup, that''s right - if it''s actually sqlite3, then you should use > adapter:sqlite3 > > > On 31/03/06, Chris Hall < christopher.k.hall@gmail.com> wrote: > > > > i think i had a similar problem. if you are using sqlite3 on your system > then you''ll want to use the sqlite3 adapter, not the sqlite adapter. > > > > give that a shot and see if it does anything. I could be way off base. > > > > > > > > On 3/31/06, Bolo Michelin <malavoi@gmail.com > wrote: > > > Hello All, > > > > > > Yesterday i put RoR with Locomotive. I am very happy :p. > > > So I follow this tuto > > > ( http://developer.apple.com/tools/rubyonrails.html). I > used Sqlite. > > > > > > my database.yml > > > # MySQL (default setup). Versions 4.1 and 5.0 are recommended. > > > # > > > # Get the fast C bindings: > > > # gem install mysql > > > # (on OS X: gem install mysql -- --include=/usr/local/lib) > > > # And be sure to use new-style password hashing: > > > # > http://dev.mysql.com/doc/refman/5.0/en/old-client.html > > > development: > > > adapter: sqlite > > > dbfile: db/expense_developement > > > > > > # Connect on a TCP socket. If omitted, the adapter will connect on > the > > > # domain socket given by socket instead. > > > #host: localhost > > > #port: 3306 > > > > > > # 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: expenses_test > > > username: root > > > password: > > > socket: /tmp/mysql.sock > > > > > > production: > > > adapter: mysql > > > database: expenses_production > > > username: root > > > password: > > > socket: /tmp/mysql.sock > > > > > > > > > # PostgreSQL versions 7.4 - 8.1 > > > # > > > # Get the C bindings: > > > # gem install postgres > > > # or use the pure-Ruby bindings on Windows: > > > # gem install postgres-pr > > > postgresql_example: > > > adapter: postgresql > > > database: expenses_development > > > username: expenses > > > password: > > > > > > # Connect on a TCP socket. Omitted by default since the client uses a > > > # domain socket that doesn''t need configuration. > > > #host: remote-database > > > #port: 5432 > > > > > > # Schema search path. The server defaults to $user,public > > > #schema_search_path: myapp,sharedapp,public > > > > > > # Character set encoding. The server defaults to sql_ascii. > > > #encoding: UTF8 > > > > > > # Minimum log levels, in increasing order: > > > # debug5, debug4, debug3, debug2, debug1, > > > # info, notice, warning, error, log, fatal, or panic > > > # The server defaults to notice. > > > #min_messages: warning > > > > > > > > > # SQLite version 2.x > > > # gem install sqlite-ruby > > > sqlite_example: > > > adapter: sqlite > > > database: db/development.sqlite2 > > > > > > > > > # SQLite version 3.x > > > # gem install sqlite3-ruby > > > sqlite3_example: > > > adapter: sqlite3 > > > database: db/development.sqlite3 > > > > > > > > > # In-memory SQLite 3 database. Useful for tests. > > > sqlite3_in_memory_example: > > > adapter: sqlite3 > > > database: ":memory:" > > > > > > When i tabe this line in Terminal > > > $ script/generate Model Expense > > > > > > I show only that > > > exists app/models/ > > > exists test/unit/ > > > exists test/fixtures/ > > > create app/models/expense.rb > > > create test/unit/expense_test.rb > > > create test/fixtures/expenses.yml > > > > > > i didn''t see this commands > > > create db/migrate > > > create db/migrate/001_create_expenses.rb > > > > > > I don''t have this folder and this file > > > > > > > > > Thanks > > > > > > Bolo > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
this my new file
development:
adapter: sqlite3
dbfile: db/expense_developement
# Connect on a TCP socket. If omitted, the adapter will connect on the
# domain socket given by socket instead.
#host: localhost
#port: 3306
# 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: sqlite3
database: expenses_test
production:
adapter: sqlite3
database: expenses_production
but always same thing
$ script/generate Model Expense
exists app/models/
exists test/unit/
exists test/fixtures/
identical app/models/expense.rb
identical test/unit/expense_test.rb
identical test/fixtures/expenses.yml
2006/3/31, Bolo Michelin <malavoi@gmail.com>:> So i must change my database.yml
> like that
> development:
> adapter: sqlite3
> dbfile: db/expense_developement
>
>
>
> 2006/3/31, Tom Armitage <tom.armitage@gmail.com>:
> > Yup, that''s right - if it''s actually sqlite3, then
you should use
> > adapter:sqlite3
> >
> >
> > On 31/03/06, Chris Hall < christopher.k.hall@gmail.com> wrote:
> > >
> > > i think i had a similar problem. if you are using sqlite3 on
your system
> > then you''ll want to use the sqlite3 adapter, not the sqlite
adapter.
> > >
> > > give that a shot and see if it does anything. I could be way off
base.
> > >
> > >
> > >
> > > On 3/31/06, Bolo Michelin <malavoi@gmail.com > wrote:
> > > > Hello All,
> > > >
> > > > Yesterday i put RoR with Locomotive. I am very happy :p.
> > > > So I follow this tuto
> > > > ( http://developer.apple.com/tools/rubyonrails.html). I
> > used Sqlite.
> > > >
> > > > my database.yml
> > > > # MySQL (default setup). Versions 4.1 and 5.0 are
recommended.
> > > > #
> > > > # Get the fast C bindings:
> > > > # gem install mysql
> > > > # (on OS X: gem install mysql -- --include=/usr/local/lib)
> > > > # And be sure to use new-style password hashing:
> > > > #
> > http://dev.mysql.com/doc/refman/5.0/en/old-client.html
> > > > development:
> > > > adapter: sqlite
> > > > dbfile: db/expense_developement
> > > >
> > > > # Connect on a TCP socket. If omitted, the adapter will
connect on
> > the
> > > > # domain socket given by socket instead.
> > > > #host: localhost
> > > > #port: 3306
> > > >
> > > > # 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: expenses_test
> > > > username: root
> > > > password:
> > > > socket: /tmp/mysql.sock
> > > >
> > > > production:
> > > > adapter: mysql
> > > > database: expenses_production
> > > > username: root
> > > > password:
> > > > socket: /tmp/mysql.sock
> > > >
> > > >
> > > > # PostgreSQL versions 7.4 - 8.1
> > > > #
> > > > # Get the C bindings:
> > > > # gem install postgres
> > > > # or use the pure-Ruby bindings on Windows:
> > > > # gem install postgres-pr
> > > > postgresql_example:
> > > > adapter: postgresql
> > > > database: expenses_development
> > > > username: expenses
> > > > password:
> > > >
> > > > # Connect on a TCP socket. Omitted by default since the
client uses a
> > > > # domain socket that doesn''t need configuration.
> > > > #host: remote-database
> > > > #port: 5432
> > > >
> > > > # Schema search path. The server defaults to $user,public
> > > > #schema_search_path: myapp,sharedapp,public
> > > >
> > > > # Character set encoding. The server defaults to
sql_ascii.
> > > > #encoding: UTF8
> > > >
> > > > # Minimum log levels, in increasing order:
> > > > # debug5, debug4, debug3, debug2, debug1,
> > > > # info, notice, warning, error, log, fatal, or panic
> > > > # The server defaults to notice.
> > > > #min_messages: warning
> > > >
> > > >
> > > > # SQLite version 2.x
> > > > # gem install sqlite-ruby
> > > > sqlite_example:
> > > > adapter: sqlite
> > > > database: db/development.sqlite2
> > > >
> > > >
> > > > # SQLite version 3.x
> > > > # gem install sqlite3-ruby
> > > > sqlite3_example:
> > > > adapter: sqlite3
> > > > database: db/development.sqlite3
> > > >
> > > >
> > > > # In-memory SQLite 3 database. Useful for tests.
> > > > sqlite3_in_memory_example:
> > > > adapter: sqlite3
> > > > database: ":memory:"
> > > >
> > > > When i tabe this line in Terminal
> > > > $ script/generate Model Expense
> > > >
> > > > I show only that
> > > > exists app/models/
> > > > exists test/unit/
> > > > exists test/fixtures/
> > > > create app/models/expense.rb
> > > > create test/unit/expense_test.rb
> > > > create test/fixtures/expenses.yml
> > > >
> > > > i didn''t see this commands
> > > > create db/migrate
> > > > create db/migrate/001_create_expenses.rb
> > > >
> > > > I don''t have this folder and this file
> > > >
> > > >
> > > > Thanks
> > > >
> > > > Bolo
> > > > _______________________________________________
> > > > Rails mailing list
> > > > Rails@lists.rubyonrails.org
> > > > http://lists.rubyonrails.org/mailman/listinfo/rails
> > > >
> > >
> > >
> > > _______________________________________________
> > > Rails mailing list
> > > Rails@lists.rubyonrails.org
> > > http://lists.rubyonrails.org/mailman/listinfo/rails
> > >
> > >
> > >
> >
> >
> > _______________________________________________
> > Rails mailing list
> > Rails@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> >
> >
> >
>
sorry to reiterate some points, but i use sqlite3 successfully so... easy steps for rails 1.1 1) rails -d sqlite3 /path/to/you/new/railsapp 2) cd /path/to/you/new/railsapp 3) rake db:schema:dump 4) ./script/generate model MyNewModel step 1 can be ommitted for an existing app - obviously! but it saves you changing anything in database.yaml except the db name step 3 may not be exact syntax - old syntax of rake db_schema_dump still works, which is all i''ve used yet - this step creates the database if it doesn''t already exist. step 4 auto creates the migration as of rails 1.1 hth On Friday 31 March 2006 18:07, Bolo Michelin wrote:> this my new file > > development: > adapter: sqlite3 > dbfile: db/expense_developement > > # Connect on a TCP socket. If omitted, the adapter will connect on the > # domain socket given by socket instead. > #host: localhost > #port: 3306 > > # 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: sqlite3 > database: expenses_test > > production: > adapter: sqlite3 > database: expenses_production > > but always same thing > > $ script/generate Model Expense > exists app/models/ > exists test/unit/ > exists test/fixtures/ > identical app/models/expense.rb > identical test/unit/expense_test.rb > identical test/fixtures/expenses.yml > > 2006/3/31, Bolo Michelin <malavoi@gmail.com>: > > So i must change my database.yml > > like that > > development: > > adapter: sqlite3 > > dbfile: db/expense_developement > > > > 2006/3/31, Tom Armitage <tom.armitage@gmail.com>: > > > Yup, that''s right - if it''s actually sqlite3, then you should use > > > adapter:sqlite3 > > > > > > On 31/03/06, Chris Hall < christopher.k.hall@gmail.com> wrote: > > > > i think i had a similar problem. if you are using sqlite3 on your > > > > system > > > > > > then you''ll want to use the sqlite3 adapter, not the sqlite adapter. > > > > > > > give that a shot and see if it does anything. I could be way off > > > > base. > > > > > > > > On 3/31/06, Bolo Michelin <malavoi@gmail.com > wrote: > > > > > Hello All, > > > > > > > > > > Yesterday i put RoR with Locomotive. I am very happy :p. > > > > > So I follow this tuto > > > > > ( http://developer.apple.com/tools/rubyonrails.html). I > > > > > > used Sqlite. > > > > > > > > my database.yml > > > > > # MySQL (default setup). Versions 4.1 and 5.0 are recommended. > > > > > # > > > > > # Get the fast C bindings: > > > > > # gem install mysql > > > > > # (on OS X: gem install mysql -- --include=/usr/local/lib) > > > > > # And be sure to use new-style password hashing: > > > > > # > > > > > > http://dev.mysql.com/doc/refman/5.0/en/old-client.html > > > > > > > > development: > > > > > adapter: sqlite > > > > > dbfile: db/expense_developement > > > > > > > > > > # Connect on a TCP socket. If omitted, the adapter will connect > > > > > on > > > > > > the > > > > > > > > # domain socket given by socket instead. > > > > > #host: localhost > > > > > #port: 3306 > > > > > > > > > > # 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: expenses_test > > > > > username: root > > > > > password: > > > > > socket: /tmp/mysql.sock > > > > > > > > > > production: > > > > > adapter: mysql > > > > > database: expenses_production > > > > > username: root > > > > > password: > > > > > socket: /tmp/mysql.sock > > > > > > > > > > > > > > > # PostgreSQL versions 7.4 - 8.1 > > > > > # > > > > > # Get the C bindings: > > > > > # gem install postgres > > > > > # or use the pure-Ruby bindings on Windows: > > > > > # gem install postgres-pr > > > > > postgresql_example: > > > > > adapter: postgresql > > > > > database: expenses_development > > > > > username: expenses > > > > > password: > > > > > > > > > > # Connect on a TCP socket. Omitted by default since the client > > > > > uses a # domain socket that doesn''t need configuration. > > > > > #host: remote-database > > > > > #port: 5432 > > > > > > > > > > # Schema search path. The server defaults to $user,public > > > > > #schema_search_path: myapp,sharedapp,public > > > > > > > > > > # Character set encoding. The server defaults to sql_ascii. > > > > > #encoding: UTF8 > > > > > > > > > > # Minimum log levels, in increasing order: > > > > > # debug5, debug4, debug3, debug2, debug1, > > > > > # info, notice, warning, error, log, fatal, or panic > > > > > # The server defaults to notice. > > > > > #min_messages: warning > > > > > > > > > > > > > > > # SQLite version 2.x > > > > > # gem install sqlite-ruby > > > > > sqlite_example: > > > > > adapter: sqlite > > > > > database: db/development.sqlite2 > > > > > > > > > > > > > > > # SQLite version 3.x > > > > > # gem install sqlite3-ruby > > > > > sqlite3_example: > > > > > adapter: sqlite3 > > > > > database: db/development.sqlite3 > > > > > > > > > > > > > > > # In-memory SQLite 3 database. Useful for tests. > > > > > sqlite3_in_memory_example: > > > > > adapter: sqlite3 > > > > > database: ":memory:" > > > > > > > > > > When i tabe this line in Terminal > > > > > $ script/generate Model Expense > > > > > > > > > > I show only that > > > > > exists app/models/ > > > > > exists test/unit/ > > > > > exists test/fixtures/ > > > > > create app/models/expense.rb > > > > > create test/unit/expense_test.rb > > > > > create test/fixtures/expenses.yml > > > > > > > > > > i didn''t see this commands > > > > > create db/migrate > > > > > create db/migrate/001_create_expenses.rb > > > > > > > > > > I don''t have this folder and this file > > > > > > > > > > > > > > > Thanks > > > > > > > > > > Bolo > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
for First point>1) rails -d sqlite3 /path/to/you/new/railsappu write this command with Locomotive ? For me Ordinateur-de-Bolo-Michelin:~/Documents/Creation_Perso/Developement/expenses bolomichelin$ rails -d sqlite3 /Documents/Creation_Perso/Developement/expenses invalid option: -d 2006/3/31, Scott Mathieson <scottjmathieson@gmail.com>:> sorry to reiterate some points, but i use sqlite3 successfully so... > > easy steps for rails 1.1 > > 1) rails -d sqlite3 /path/to/you/new/railsapp > 2) cd /path/to/you/new/railsapp > 3) rake db:schema:dump > 4) ./script/generate model MyNewModel > > step 1 can be ommitted for an existing app - obviously! but it saves you > changing anything in database.yaml except the db name > > step 3 may not be exact syntax - old syntax of rake db_schema_dump still > works, which is all i''ve used yet - this step creates the database if it > doesn''t already exist. > > step 4 auto creates the migration as of rails 1.1 > > hth > > > On Friday 31 March 2006 18:07, Bolo Michelin wrote: > > this my new file > > > > development: > > adapter: sqlite3 > > dbfile: db/expense_developement > > > > # Connect on a TCP socket. If omitted, the adapter will connect on the > > # domain socket given by socket instead. > > #host: localhost > > #port: 3306 > > > > # 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: sqlite3 > > database: expenses_test > > > > production: > > adapter: sqlite3 > > database: expenses_production > > > > but always same thing > > > > $ script/generate Model Expense > > exists app/models/ > > exists test/unit/ > > exists test/fixtures/ > > identical app/models/expense.rb > > identical test/unit/expense_test.rb > > identical test/fixtures/expenses.yml > > > > 2006/3/31, Bolo Michelin <malavoi@gmail.com>: > > > So i must change my database.yml > > > like that > > > development: > > > adapter: sqlite3 > > > dbfile: db/expense_developement > > > > > > 2006/3/31, Tom Armitage <tom.armitage@gmail.com>: > > > > Yup, that''s right - if it''s actually sqlite3, then you should use > > > > adapter:sqlite3 > > > > > > > > On 31/03/06, Chris Hall < christopher.k.hall@gmail.com> wrote: > > > > > i think i had a similar problem. if you are using sqlite3 on your > > > > > system > > > > > > > > then you''ll want to use the sqlite3 adapter, not the sqlite adapter. > > > > > > > > > give that a shot and see if it does anything. I could be way off > > > > > base. > > > > > > > > > > On 3/31/06, Bolo Michelin <malavoi@gmail.com > wrote: > > > > > > Hello All, > > > > > > > > > > > > Yesterday i put RoR with Locomotive. I am very happy :p. > > > > > > So I follow this tuto > > > > > > ( http://developer.apple.com/tools/rubyonrails.html). I > > > > > > > > used Sqlite. > > > > > > > > > > my database.yml > > > > > > # MySQL (default setup). Versions 4.1 and 5.0 are recommended. > > > > > > # > > > > > > # Get the fast C bindings: > > > > > > # gem install mysql > > > > > > # (on OS X: gem install mysql -- --include=/usr/local/lib) > > > > > > # And be sure to use new-style password hashing: > > > > > > # > > > > > > > > http://dev.mysql.com/doc/refman/5.0/en/old-client.html > > > > > > > > > > development: > > > > > > adapter: sqlite > > > > > > dbfile: db/expense_developement > > > > > > > > > > > > # Connect on a TCP socket. If omitted, the adapter will connect > > > > > > on > > > > > > > > the > > > > > > > > > > # domain socket given by socket instead. > > > > > > #host: localhost > > > > > > #port: 3306 > > > > > > > > > > > > # 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: expenses_test > > > > > > username: root > > > > > > password: > > > > > > socket: /tmp/mysql.sock > > > > > > > > > > > > production: > > > > > > adapter: mysql > > > > > > database: expenses_production > > > > > > username: root > > > > > > password: > > > > > > socket: /tmp/mysql.sock > > > > > > > > > > > > > > > > > > # PostgreSQL versions 7.4 - 8.1 > > > > > > # > > > > > > # Get the C bindings: > > > > > > # gem install postgres > > > > > > # or use the pure-Ruby bindings on Windows: > > > > > > # gem install postgres-pr > > > > > > postgresql_example: > > > > > > adapter: postgresql > > > > > > database: expenses_development > > > > > > username: expenses > > > > > > password: > > > > > > > > > > > > # Connect on a TCP socket. Omitted by default since the client > > > > > > uses a # domain socket that doesn''t need configuration. > > > > > > #host: remote-database > > > > > > #port: 5432 > > > > > > > > > > > > # Schema search path. The server defaults to $user,public > > > > > > #schema_search_path: myapp,sharedapp,public > > > > > > > > > > > > # Character set encoding. The server defaults to sql_ascii. > > > > > > #encoding: UTF8 > > > > > > > > > > > > # Minimum log levels, in increasing order: > > > > > > # debug5, debug4, debug3, debug2, debug1, > > > > > > # info, notice, warning, error, log, fatal, or panic > > > > > > # The server defaults to notice. > > > > > > #min_messages: warning > > > > > > > > > > > > > > > > > > # SQLite version 2.x > > > > > > # gem install sqlite-ruby > > > > > > sqlite_example: > > > > > > adapter: sqlite > > > > > > database: db/development.sqlite2 > > > > > > > > > > > > > > > > > > # SQLite version 3.x > > > > > > # gem install sqlite3-ruby > > > > > > sqlite3_example: > > > > > > adapter: sqlite3 > > > > > > database: db/development.sqlite3 > > > > > > > > > > > > > > > > > > # In-memory SQLite 3 database. Useful for tests. > > > > > > sqlite3_in_memory_example: > > > > > > adapter: sqlite3 > > > > > > database: ":memory:" > > > > > > > > > > > > When i tabe this line in Terminal > > > > > > $ script/generate Model Expense > > > > > > > > > > > > I show only that > > > > > > exists app/models/ > > > > > > exists test/unit/ > > > > > > exists test/fixtures/ > > > > > > create app/models/expense.rb > > > > > > create test/unit/expense_test.rb > > > > > > create test/fixtures/expenses.yml > > > > > > > > > > > > i didn''t see this commands > > > > > > create db/migrate > > > > > > create db/migrate/001_create_expenses.rb > > > > > > > > > > > > I don''t have this folder and this file > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > Bolo > > > > > > _______________________________________________ > > > > > > Rails mailing list > > > > > > Rails@lists.rubyonrails.org > > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
sorry, i may have confused the issue - is locomotive rails 1.1? i''m on linux, not mac osx i believe the -d, --database=name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3) options are only 1.1 (or i didnt notice them before) like i said though it just means one less step - you can still just edit your database.yaml file (which is essentially all that option does) if you''re rails 1.0 then build the app, edit the database.yaml and uncomment the line # config.active_record.schema_format = :ruby in environment.rb before doing the db dump using rake db_schema_dump you''ll have to create your migrations manually using ./script/generate migration create_my_model_name or whatever so 1) ./script/generate migration create_my_model_name 2) rake migrate 3) ./script/generate model MyModelName hope this helps - sorry for any confusion On Friday 31 March 2006 19:56, Bolo Michelin wrote:> for First point > > >1) rails -d sqlite3 /path/to/you/new/railsapp > > u write this command with Locomotive ? > > For me > Ordinateur-de-Bolo-Michelin:~/Documents/Creation_Perso/Developement/expense >s bolomichelin$ rails -d sqlite3 > /Documents/Creation_Perso/Developement/expenses > > invalid option: -d
AND! you may want to check out DHH''s screencast on migrations if you haven''t already done so- http://media.rubyonrails.org/video/migrations.mov On Friday 31 March 2006 20:20, Scott Mathieson wrote:> sorry, i may have confused the issue - is locomotive rails 1.1? i''m on > linux, not mac osx > > i believe the > -d, --database=name Preconfigure for selected database > (options: mysql/oracle/postgresql/sqlite2/sqlite3) > > options are only 1.1 (or i didnt notice them before) > > like i said though it just means one less step - you can still just edit > your database.yaml file (which is essentially all that option does) > > if you''re rails 1.0 then build the app, edit the database.yaml and > uncomment the line > # config.active_record.schema_format = :ruby > > in environment.rb > > before doing the db dump using rake db_schema_dump > > you''ll have to create your migrations manually using > > ./script/generate migration create_my_model_name > > or whatever > > so > 1) ./script/generate migration create_my_model_name > 2) rake migrate > 3) ./script/generate model MyModelName > > hope this helps - sorry for any confusion > > On Friday 31 March 2006 19:56, Bolo Michelin wrote: > > for First point > > > > >1) rails -d sqlite3 /path/to/you/new/railsapp > > > > u write this command with Locomotive ? > > > > For me > > Ordinateur-de-Bolo-Michelin:~/Documents/Creation_Perso/Developement/expen > >se s bolomichelin$ rails -d sqlite3 > > /Documents/Creation_Perso/Developement/expenses > > > > invalid option: -d > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Yes But maybe the problem from Locomotive. I don''t know
I use Rail 1.1
in terminal i tape this
Ordinateur-de-Bolo-Michelin:$ d, --database=expenses
-bash: d,: command not found
Ordinateur-de-Bolo-Michelin:$ railsd, --database=expenses
-bash: railsd,: command not found
Ordinateur-de-Bolo-Michelin:$ rails d, --database=expenses
invalid option: --database=expenses
No Working for me :(
I tested the second solution
Ordinateur-de-Bolo-Michelin:$ ./script/generate migration Expense
create db/migrate
create db/migrate/001_expense.rb
Ok After i create my table in 001_expenses
class Expense < ActiveRecord::Migration
def self.up
create_table :account do|table|
table.column :name, :string
table.column :budget, :float
end
end
def self.down
drop_table :accounts
end
end
Then
Ordinateur-de-Bolo-Michelin:$ rake migrate
(in /Users/bolomichelin/Documents/Creation_Perso/Developement/expenses)
and all.
My table was not created :( :(
2006/3/31, Scott Mathieson
<scottjmathieson@gmail.com>:> sorry, i may have confused the issue - is locomotive rails 1.1?
i''m on linux,
> not mac osx
>
> i believe the
> -d, --database=name Preconfigure for selected database
(options:
> mysql/oracle/postgresql/sqlite2/sqlite3)
>
> options are only 1.1 (or i didnt notice them before)
>
> like i said though it just means one less step - you can still just edit
your
> database.yaml file (which is essentially all that option does)
>
> if you''re rails 1.0 then build the app, edit the database.yaml and
uncomment
> the line
> # config.active_record.schema_format = :ruby
>
> in environment.rb
>
> before doing the db dump using rake db_schema_dump
>
> you''ll have to create your migrations manually using
>
> ./script/generate migration create_my_model_name
>
> or whatever
>
> so
> 1) ./script/generate migration create_my_model_name
> 2) rake migrate
> 3) ./script/generate model MyModelName
>
> hope this helps - sorry for any confusion
>
>
> On Friday 31 March 2006 19:56, Bolo Michelin wrote:
> > for First point
> >
> > >1) rails -d sqlite3 /path/to/you/new/railsapp
> >
> > u write this command with Locomotive ?
> >
> > For me
> >
Ordinateur-de-Bolo-Michelin:~/Documents/Creation_Perso/Developement/expense
> >s bolomichelin$ rails -d sqlite3
> > /Documents/Creation_Perso/Developement/expenses
> >
> > invalid option: -d
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
ok first off it''s either
rails -d sqlite3 /path/to/app
OR
rails --database=sqlite3 /path/to/app
running rails --help will tell you all this - but like i said its only a
shortcut
migration looks ok, apart from :float - im not 100% if sqlite3 supports floats
you better check the docs (sqlite.org) - i dont use them (i would store cents
in the db rather than dollars for instance, and do the necessary translation
in the model)
i''m assuming
create_table :account do|table|
should be
create_table :accounts do |table|
here''s one lifted from a working app
class CreateTaggings < ActiveRecord::Migration
def self.up
create_table :taggings do |t|
t.column :tag_id, :integer, :limit => 11, :null => false
t.column :taggable_id, :integer, :limit => 11, :null => false
t.column :taggable_type, :string, :limit => 255, :default =>
'''', :null
=> false
end
add_index ''taggings'', [''tag_id''], :name
=> ''fk_taggings_tag''
end
def self.down
drop_table :taggings
end
end
that said, are you sure the database exists after dumping the schema? file
permissions ok? you dont mention any error messages
only other thing that i can think of is that its something to do with
locomotive, which i cannot help with
good luck
On Friday 31 March 2006 20:41, Bolo Michelin wrote:> Yes But maybe the problem from Locomotive. I don''t know
> I use Rail 1.1
>
> in terminal i tape this
> Ordinateur-de-Bolo-Michelin:$ d, --database=expenses
> -bash: d,: command not found
>
> Ordinateur-de-Bolo-Michelin:$ railsd, --database=expenses
> -bash: railsd,: command not found
>
> Ordinateur-de-Bolo-Michelin:$ rails d, --database=expenses
> invalid option: --database=expenses
>
> No Working for me :(
> I tested the second solution
> Ordinateur-de-Bolo-Michelin:$ ./script/generate migration Expense
> create db/migrate
> create db/migrate/001_expense.rb
>
> Ok After i create my table in 001_expenses
> class Expense < ActiveRecord::Migration
> def self.up
> create_table :account do|table|
> table.column :name, :string
> table.column :budget, :float
> end
> end
>
> def self.down
> drop_table :accounts
> end
> end
>
> Then
>
> Ordinateur-de-Bolo-Michelin:$ rake migrate
> (in /Users/bolomichelin/Documents/Creation_Perso/Developement/expenses)
>
> and all.
> My table was not created :( :(
I delete the app and i create a new.
my database.yml
*********************************************
development:
adapter: sqlite3
database: db/expense_development.sqlite3
test:
adapter: sqlite3
database: db/expense_test.sqlite3
production:
development
*********************************************
my table accounts
*********************************************
class Account < ActiveRecord::Migration
def self.up
puts ''Creating Table: accounts...''
create_table :accounts, :force => true do |t|
t.column :name, :string
t.column :budget, :float
end
end
def self.down
puts ''Deleteing Table: accounts''
drop_table :accounts
end
end
*********************************************
when i teste rake migrate ,i have this now
$ rake migrate
(in /Users/bolomichelin/Documents/Creation_Perso/Developement/expense)
rake aborted!
parse error on line 9, col 12: `''
:(
2006/3/31, Scott Mathieson
<scottjmathieson@gmail.com>:> ok first off it''s either
>
> rails -d sqlite3 /path/to/app
>
> OR
>
> rails --database=sqlite3 /path/to/app
>
> running rails --help will tell you all this - but like i said its only a
> shortcut
>
>
> migration looks ok, apart from :float - im not 100% if sqlite3 supports
floats
> you better check the docs (sqlite.org) - i dont use them (i would store
cents
> in the db rather than dollars for instance, and do the necessary
translation
> in the model)
>
> i''m assuming
> create_table :account do|table|
> should be
> create_table :accounts do |table|
>
> here''s one lifted from a working app
>
> class CreateTaggings < ActiveRecord::Migration
> def self.up
> create_table :taggings do |t|
> t.column :tag_id, :integer, :limit => 11, :null => false
> t.column :taggable_id, :integer, :limit => 11, :null => false
> t.column :taggable_type, :string, :limit => 255, :default =>
'''', :null
> => false
> end
> add_index ''taggings'', [''tag_id''],
:name => ''fk_taggings_tag''
> end
>
> def self.down
> drop_table :taggings
> end
> end
>
> that said, are you sure the database exists after dumping the schema? file
> permissions ok? you dont mention any error messages
> only other thing that i can think of is that its something to do with
> locomotive, which i cannot help with
>
> good luck
>
> On Friday 31 March 2006 20:41, Bolo Michelin wrote:
> > Yes But maybe the problem from Locomotive. I don''t know
> > I use Rail 1.1
> >
> > in terminal i tape this
> > Ordinateur-de-Bolo-Michelin:$ d, --database=expenses
> > -bash: d,: command not found
> >
> > Ordinateur-de-Bolo-Michelin:$ railsd, --database=expenses
> > -bash: railsd,: command not found
> >
> > Ordinateur-de-Bolo-Michelin:$ rails d, --database=expenses
> > invalid option: --database=expenses
> >
> > No Working for me :(
> > I tested the second solution
> > Ordinateur-de-Bolo-Michelin:$ ./script/generate migration Expense
> > create db/migrate
> > create db/migrate/001_expense.rb
> >
> > Ok After i create my table in 001_expenses
> > class Expense < ActiveRecord::Migration
> > def self.up
> > create_table :account do|table|
> > table.column :name, :string
> > table.column :budget, :float
> > end
> > end
> >
> > def self.down
> > drop_table :accounts
> > end
> > end
> >
> > Then
> >
> > Ordinateur-de-Bolo-Michelin:$ rake migrate
> > (in
/Users/bolomichelin/Documents/Creation_Perso/Developement/expenses)
> >
> > and all.
> > My table was not created :( :(
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Working !! production: adapter: sqlite3 database: db/expense_production.sqlite3 i change my database.yml :p thanks 2006/3/31, Bolo Michelin <malavoi@gmail.com>:> I delete the app and i create a new. > my database.yml > ********************************************* > development: > adapter: sqlite3 > database: db/expense_development.sqlite3 > > test: > adapter: sqlite3 > database: db/expense_test.sqlite3 > > production: > development > ********************************************* > my table accounts > ********************************************* > class Account < ActiveRecord::Migration > def self.up > puts ''Creating Table: accounts...'' > create_table :accounts, :force => true do |t| > t.column :name, :string > t.column :budget, :float > end > end > > def self.down > puts ''Deleteing Table: accounts'' > drop_table :accounts > end > end > ********************************************* > > when i teste rake migrate ,i have this now > $ rake migrate > (in /Users/bolomichelin/Documents/Creation_Perso/Developement/expense) > rake aborted! > parse error on line 9, col 12: `'' > :( > > > 2006/3/31, Scott Mathieson <scottjmathieson@gmail.com>: > > ok first off it''s either > > > > rails -d sqlite3 /path/to/app > > > > OR > > > > rails --database=sqlite3 /path/to/app > > > > running rails --help will tell you all this - but like i said its only a > > shortcut > > > > > > migration looks ok, apart from :float - im not 100% if sqlite3 supports floats > > you better check the docs (sqlite.org) - i dont use them (i would store cents > > in the db rather than dollars for instance, and do the necessary translation > > in the model) > > > > i''m assuming > > create_table :account do|table| > > should be > > create_table :accounts do |table| > > > > here''s one lifted from a working app > > > > class CreateTaggings < ActiveRecord::Migration > > def self.up > > create_table :taggings do |t| > > t.column :tag_id, :integer, :limit => 11, :null => false > > t.column :taggable_id, :integer, :limit => 11, :null => false > > t.column :taggable_type, :string, :limit => 255, :default => '''', :null > > => false > > end > > add_index ''taggings'', [''tag_id''], :name => ''fk_taggings_tag'' > > end > > > > def self.down > > drop_table :taggings > > end > > end > > > > that said, are you sure the database exists after dumping the schema? file > > permissions ok? you dont mention any error messages > > only other thing that i can think of is that its something to do with > > locomotive, which i cannot help with > > > > good luck > > > > On Friday 31 March 2006 20:41, Bolo Michelin wrote: > > > Yes But maybe the problem from Locomotive. I don''t know > > > I use Rail 1.1 > > > > > > in terminal i tape this > > > Ordinateur-de-Bolo-Michelin:$ d, --database=expenses > > > -bash: d,: command not found > > > > > > Ordinateur-de-Bolo-Michelin:$ railsd, --database=expenses > > > -bash: railsd,: command not found > > > > > > Ordinateur-de-Bolo-Michelin:$ rails d, --database=expenses > > > invalid option: --database=expenses > > > > > > No Working for me :( > > > I tested the second solution > > > Ordinateur-de-Bolo-Michelin:$ ./script/generate migration Expense > > > create db/migrate > > > create db/migrate/001_expense.rb > > > > > > Ok After i create my table in 001_expenses > > > class Expense < ActiveRecord::Migration > > > def self.up > > > create_table :account do|table| > > > table.column :name, :string > > > table.column :budget, :float > > > end > > > end > > > > > > def self.down > > > drop_table :accounts > > > end > > > end > > > > > > Then > > > > > > Ordinateur-de-Bolo-Michelin:$ rake migrate > > > (in /Users/bolomichelin/Documents/Creation_Perso/Developement/expenses) > > > > > > and all. > > > My table was not created :( :( > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
i wouldnt''t be putting the puts ... statements in there if i were you - lose them have you tried :integer instead of :float rails 1.1 use db:migrate and it will give you a verbose output of what it''s doing - i''ve given you both syntaxes already On Friday 31 March 2006 21:36, Bolo Michelin wrote:> class Account < ActiveRecord::Migration > ? def self.up > ? ? puts ''Creating Table: accounts...'' > ? ? create_table :accounts, :force => true do |t| > ? ? ? t.column :name, :string > ? ? ? t.column :budget, :float > ? ? end > ? end > > ? def self.down > ? ? puts ''Deleteing Table: accounts'' > ? ? drop_table :accounts > ? end > end
cool - thought you had that ok anyway, was it the file extension? On Friday 31 March 2006 21:50, Bolo Michelin wrote:> Working !! > production: > adapter: sqlite3 > database: db/expense_production.sqlite3 > i change my database.yml :p > > thanks > > 2006/3/31, Bolo Michelin <malavoi@gmail.com>: > > I delete the app and i create a new. > > my database.yml > > ********************************************* > > development: > > adapter: sqlite3 > > database: db/expense_development.sqlite3 > > > > test: > > adapter: sqlite3 > > database: db/expense_test.sqlite3 > > > > production: > > development > > ********************************************* > > my table accounts > > ********************************************* > > class Account < ActiveRecord::Migration > > def self.up > > puts ''Creating Table: accounts...'' > > create_table :accounts, :force => true do |t| > > t.column :name, :string > > t.column :budget, :float > > end > > end > > > > def self.down > > puts ''Deleteing Table: accounts'' > > drop_table :accounts > > end > > end > > ********************************************* > > > > when i teste rake migrate ,i have this now > > $ rake migrate > > (in /Users/bolomichelin/Documents/Creation_Perso/Developement/expense) > > rake aborted! > > parse error on line 9, col 12: `'' > > > > :( > > > > 2006/3/31, Scott Mathieson <scottjmathieson@gmail.com>: > > > ok first off it''s either > > > > > > rails -d sqlite3 /path/to/app > > > > > > OR > > > > > > rails --database=sqlite3 /path/to/app > > > > > > running rails --help will tell you all this - but like i said its only > > > a shortcut > > > > > > > > > migration looks ok, apart from :float - im not 100% if sqlite3 supports > > > floats you better check the docs (sqlite.org) - i dont use them (i > > > would store cents in the db rather than dollars for instance, and do > > > the necessary translation in the model) > > > > > > i''m assuming > > > create_table :account do|table| > > > should be > > > create_table :accounts do |table| > > > > > > here''s one lifted from a working app > > > > > > class CreateTaggings < ActiveRecord::Migration > > > def self.up > > > create_table :taggings do |t| > > > t.column :tag_id, :integer, :limit => 11, :null => false > > > t.column :taggable_id, :integer, :limit => 11, :null => false > > > t.column :taggable_type, :string, :limit => 255, :default => '''', > > > :null => false > > > end > > > add_index ''taggings'', [''tag_id''], :name => ''fk_taggings_tag'' > > > end > > > > > > def self.down > > > drop_table :taggings > > > end > > > end > > > > > > that said, are you sure the database exists after dumping the schema? > > > file permissions ok? you dont mention any error messages > > > only other thing that i can think of is that its something to do with > > > locomotive, which i cannot help with > > > > > > good luck > > > > > > On Friday 31 March 2006 20:41, Bolo Michelin wrote: > > > > Yes But maybe the problem from Locomotive. I don''t know > > > > I use Rail 1.1 > > > > > > > > in terminal i tape this > > > > Ordinateur-de-Bolo-Michelin:$ d, --database=expenses > > > > -bash: d,: command not found > > > > > > > > Ordinateur-de-Bolo-Michelin:$ railsd, --database=expenses > > > > -bash: railsd,: command not found > > > > > > > > Ordinateur-de-Bolo-Michelin:$ rails d, --database=expenses > > > > invalid option: --database=expenses > > > > > > > > No Working for me :( > > > > I tested the second solution > > > > Ordinateur-de-Bolo-Michelin:$ ./script/generate migration Expense > > > > create db/migrate > > > > create db/migrate/001_expense.rb > > > > > > > > Ok After i create my table in 001_expenses > > > > class Expense < ActiveRecord::Migration > > > > def self.up > > > > create_table :account do|table| > > > > table.column :name, :string > > > > table.column :budget, :float > > > > end > > > > end > > > > > > > > def self.down > > > > drop_table :accounts > > > > end > > > > end > > > > > > > > Then > > > > > > > > Ordinateur-de-Bolo-Michelin:$ rake migrate > > > > (in > > > > /Users/bolomichelin/Documents/Creation_Perso/Developement/expenses) > > > > > > > > and all. > > > > My table was not created :( :( > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails