similar to: Migration crashes when using braces to delimit blocks

Displaying 20 results from an estimated 3000 matches similar to: "Migration crashes when using braces to delimit blocks"

2009 Jul 21
1
synatx error while running migration
hello to all, i am getting weird syntax error while running the rake db:migrate syntax error, unexpected tSYMBEG, expecting kDO or ''{'' or ''('' Apparently i am creating an engine in my main application using ''ruby script/generate plugin'' command in rails 2.3.0 with engine having its own separate database define in database.yml of main
2007 Apr 17
2
Rake aborted - syntax error, unexpected $end, expecting kEND
I can''t create tables via rake db:migrate without encountering this error: rake aborted! ./db/migrate//001_create_users_table.rb:11: syntax error, unexpected $end, expecting kEND The 001_create_users_table.rb file contains: class CreateUsersTable < ActiveRecord::Migration def self.up create_table "users" do |table| end def self.down end end I''ve
2006 Apr 20
4
Newbee rake migrate question
with a simple table def. class Objects < ActiveRecord::Migration def self.up create_table :objects do |table| table.column :name, string end def self.down drop_table :objects end end when I run rake migrate, I get: ** Invoke migrate (first_time) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake
2006 Mar 26
2
File_Column plugin causes strange errors on windows
I installed the File_Column plugin and setup my relationships. create_table "screenshots", :force => true do |t| t.column "image", :string, :limit => 255, :null => false t.column "description", :text t.column "created_on", :datetime, :null => false t.column "item_id", :integer, :null => false t.column
2006 Nov 24
6
Rails 1.2 RC1 problem
Hi Have this helper method inside a sites_helper.rb module def distritos [ ['0', 'Todos'], ['1', 'Aveiro'], ['2', 'Beja'], ['3', 'Braga'], ['4', 'Brangança'], ['5', 'Castelo Branco'], ['6', 'Coimbra'], ['7',
2006 Apr 19
6
undefined method `create_table'' for #<LoginController:0x5e60
I am geeting the foolowing error. undefined method `create_table'' for #<LoginController:0x5e60110> I wrote the crete action in application controller. I am coping ther total worng please help me! class ApplicationController < ActionController::Base model :cart model :line_item before_filter :authorize def create # create_table() yields a TableDefinition instance
2007 Aug 12
10
about chinese display
hello: I have built a project with Instant Rails.Now only a database and a scaffold based on a product model have finished.But when i inputted "../admin/list" in my browser,i found my chinese characters cound not display normally.Then i made five steps: 1 ajusting encoding in my browser menu 2 in "C:\InstantRails\conf_files\my.ini"directory,making sure
2006 Apr 03
2
HABTM migrations
Bad rails day for Matt- In a migration, for a habtm: create_table :teams_users do |t| t.column :team_id, :integer t.column :user_id, :integer end Ok, fine. In a controller (well really a migration script): @user.teams << Team.find( 3 ) And the SQL pumped at my server is: INSERT INTO teams_users (`team_id`, `id`, `user_id`) VALUES (3, 3, 34) Which
2007 May 28
2
helper with block compile error
HI, i''m trying to write a helper that replaces link_to_remote that accepts a block but it gets a compile error in the template: I don''t know what I''m doing wrong... TIA # application_helper.rb def link_block_to_remote( options = {}, html_options = {}, &block) concat(link_to_remote(capture(&block), options, html_options), block.binding) end # in
2006 Mar 31
2
A.R. Associations problem
Hello, I''m learning A.R Associations by creating a simple forum that consists of 3 tables: ahuthors, topics and posts. This is the schema: class AddAuthorAndTopicAndPostTables < ActiveRecord::Migration def self.up create_table :authors do |t| t.column :username, :string t.column :email, :string t.column :created_on, :datetime end create_table
2007 Jun 21
2
Error when trying to run expense program
Guys, I m trying to get up to speed on Rails via the Apple tutorial at:http://developer.apple.com/tools/rubyonrails.html Problem is when I try and access localhost:3000/expenses I get the following error. It may be a breeze for you to figure out but since I dont know jack about rails it seems cryptic to me. Application.rb seems to be very similar to the database.yml file. I''m running
2007 Feb 16
5
rake db:migrate - error 'tSYMBEG'
I''m going through the ''Depot'' project in "Agile Web Development with Rails". I just made the 003_add_test_data.rb file and when I do a "rake db:migrate", I get this error and I can''t figure out what is wrong: rake aborted! ./db/migrate//003_add_test_data.rb:5: parse error, unexpected tSYMBEG 5. :description => (and the
2006 Jun 13
11
Question: Migration - multiple creates
I want to create a migration file that creates multiple tables, so i''m guessing the correct format would be: Can anyone confirm ? I''m guessing that each new create script requires a seperate class so formatted this way. Perhaps I''m wrong. TIA Stuart class CreateTable1 < ActiveRecord::Migration def self.up create_table :table1s do |t| t.column :length,
2006 Apr 04
4
How to read rails documentation
One of the criticism I have heard about rails is that the documentation is bad. I must admit I have a hard time trying to follow it and I wonder if anyone can shed some light on it for me. For example, I am looking at the schema.rb file generated and I noticed this line: create_table "accounts", :force => true do |t| I thought to myself, what does :force => true mean? So I
2003 Oct 21
1
Why does fstab fail when command line mount works?
Okay; I'm stumped. My old boss just asked me a question, and I thought I had an easy answer, but nooooooooo. I also apologize if this has been hashed out, but I'm unable to find the answers after several pages of Google hits. Anyway, if I try to do this: mount -t smbfs -o username=kend,password=blah,workgroup=xanoptix //freedom/kend /mnt/smb/ from the command line, it works fine.
2006 Jun 05
5
adding habtm through migrations
Hello, I''m stuck, I''ve got a model Product and would like to add a new model called Category. Furthermore, I want to set up a many2many relationship between the mentioned models. the problem is that I do not know how to set the primary key in the categories_products table. this is what I''ve got in my migration file: create_table :categories do |t| t.column :name,
2006 Jun 23
1
Describing a "replaces" relationship within the same model
Hi! I would like to describe the relationships between two objects of a model, where one of the objects replaces the other. I want to be able to tell if one object has been replaced and, if so, by what object; and vice versa what object an object replaces, if any. My idea was the following: create_table :events do |t| t.column :replacement_id, :integer t.column :description, :text,
2006 Jul 10
2
Polymorphic associations in reverse?
My app has an association that''s got me scratching my head. I have Users, and Images. A User has many Images. (Yes, another picture sharing app, but it''s for a small niche, and it doesn''t end in -r!) I would like to express a "Favorite" relationship between both Users to Users, and Users to Images. This seems like the opposite of the standard
2006 Aug 13
4
has_many and foreign_key question
Alright, noob here, etc. etc. Trying to figure out the has_many usage. If I understand correctly, when you declare that a table/class has_many whatevers, the rails assumption is that there will be a foreign key in the whatevers table pointing back to the ''id'' primary key in the first table. This doesn''t seem to be the only way to have a ''has_many''
2011 Sep 04
2
has_many :through basic fubar
I''m trying to do, what seems like, a very basic join. However, the association just doesn''t seem to work. I''m sure it''s something very simple but I don''t know what. class Role < ActiveRecord::Base belongs_to :packages belongs_to :users end class Package < ActiveRecord::Base has_many :roles has_many :users, :through => :roles end