When in Terminal on Mac OS X, I get this syntax error when I run the "rake migrate" command: rake migrate --trace (in /Users/dillon/Documents/rails/expenses/expenses) ** Invoke migrate (first_time) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! ./db/migrate//001_accounts.rb:1: syntax error, unexpected '':'', expecting ''\n'' or '';'' endndrop_table :accountset, :floatle|ion ^ /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:343:in `migration_classes'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:248:in `inject'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:342:in `each'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:342:in `inject'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:342:in `migration_classes'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:330:in `migrate'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:297:in `up'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:288:in `migrate'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:4 /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `call'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `each'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in `invoke'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `synchronize'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:376:in `invoke_prerequisites'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `send'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in `each'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:375:in `invoke_prerequisites'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:368:in `invoke'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `synchronize'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `each'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7 /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/bin/rake:16:in `load'' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/bin/rake:16 --- I''m following this tutorial: http://developer.apple.com/tools/rubyonrails.html Apparently I''m running Ruby 1.8.6 and the tutorial was made for Ruby 1.8.4. Can anyone help me figure out how to fix it? The problem comes in the expenses/db/migrate/001_accounts.rb I can''t get it to post the tables to the development database I have on mySQL. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Dillon Decicio wrote:> ./db/migrate//001_accounts.rb:1: syntax error, unexpected '':'', expecting > ''\n'' or '';'' > endndrop_table :accountset, :floatle|ion > ^There appears to be an error in your migration file. It seems like you have an extra colon, perhaps at the end of a line, but without seeing the migration contents it''s difficult to say for sure... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Bush wrote:> Dillon Decicio wrote: >> ./db/migrate//001_accounts.rb:1: syntax error, unexpected '':'', expecting >> ''\n'' or '';'' >> endndrop_table :accountset, :floatle|ion >> ^ > > There appears to be an error in your migration file. It seems like you > have an extra colon, perhaps at the end of a line, but without seeing > the migration contents it''s difficult to say for sure...Here''s the file: --- class Accounts < ActiveRecord::Migration def self.up create_table :accounts do |table| table.column :name, :string table.column :budget, :float end end def self.down drop_table :accounts end end --- Sorry, I''m new to Ruby on Rails. I just wanted to follow the tutorial to see what I could learn. I figured it was a syntax error like this, but since I don''t know the syntax... I''m not sure. Maybe you could supply an explanation too? If not, at least show what I did wrong. Thanks for your prompt response. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hey, that could be because of lf/cr issues. Julian On 31/03/2008, at 10:13 AM, Dillon Decicio wrote:> > Mark Bush wrote: >> Dillon Decicio wrote: >>> ./db/migrate//001_accounts.rb:1: syntax error, unexpected '':'', >>> expecting >>> ''\n'' or '';'' >>> endndrop_table :accountset, :floatle|ion >>> ^ >> >> There appears to be an error in your migration file. It seems like >> you >> have an extra colon, perhaps at the end of a line, but without seeing >> the migration contents it''s difficult to say for sure... > > Here''s the file: > > --- > > class Accounts < ActiveRecord::Migration > > def self.up > create_table :accounts do |table| > table.column :name, :string > table.column :budget, :float > end > end > > def self.down > drop_table :accounts > end > end > > --- > > Sorry, I''m new to Ruby on Rails. I just wanted to follow the > tutorial to > see what I could learn. I figured it was a syntax error like this, but > since I don''t know the syntax... I''m not sure. > > Maybe you could supply an explanation too? If not, at least show > what I > did wrong. > > Thanks for your prompt response. > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
How would you fix that lf/cr issue? Since, I''m not sure what it is based off of just following a tutorial and not experience. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Well I can''t see anything wrong with the syntax of your migration, so I''m kind of clutching at straws. You''re using OS/X, so if you''re also using TextMate, you shouldn''t have any issues. I''d say the other part of your code would be causing issues too if it really were an lf/cr issue. It''s an odd issue! Julian. On 31/03/2008, at 11:24 AM, Dillon Decicio wrote:> > How would you fix that lf/cr issue? Since, I''m not sure what it is > based > off of just following a tutorial and not experience. > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The issue turned out to be in the config file database.yml. I fixed that, and now it''s telling my database on MySQL isn''t set up. I have a database for this application.... But for some reason it still says the command won''t work. Do you know any reason that might occur? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Alright... Now I''ve tried re-installing Locomotive, and creating an entirely new rails application. This was the output when I followed the instructions over: --- DDComp:~/new dillon$ script/generate migration accounts /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:204:in `establish_connection'': development database is not configured (ActiveRecord::AdapterNotSpecified) from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:195:in `establish_connection'' from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:229:in `initialize_database'' from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:88:in `process'' from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:43:in `send'' from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:43:in `run'' from ./script/../config/../config/environment.rb:13 from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/generate.rb:1 from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from script/generate:3 --- This was for trying to generate the migration file. The other thing worth noting, was that I could not use port 3000 anymore for development. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---