Re: [typo] Installation typo6.0.4 failed on Ruby 1.9.2 and rails3.0.5

2011-04-17 Thread Matijs van Zuijlen

Hi Ken,

On 03/24/2011 02:48 AM, ken wang wrote:

I installed the sqlite3,and also copied the sqlite dll to ruby's bin
dir. Anyone can tell me what's wrong with my opeoration?
1 When using the default database.yml, and change the password to my
local paasword.
When exec bundle install, mysql 2.8.1 is installed.
Then exec rake RAILS_ENV=production db:create, return already exists as
ECHO1 in attachs:


If you want to use sqlite3, you have to also set the adapter to sqlite3 in the 
database.yml. Since you didn't do that, bundler will install mysql for you.


Segmentation faults in Ruby are really outside the scope of Typo. You may have 
better luck contacting a mailing list related to the mingw distribution of Ruby 
you're using.



2 I changed the configuration of database and gemfile. Replace all the
mysql to mysql2.
When exec bundle istall, it using the mysql2 (0.2.6)
When exec rake RAILS_ENV=production db:migrate, returns as ECHO2 in
attachs:


This looks more promising ...


3 when change the database config as follows:
production:
   adapter: mysql2
   encoding: utf8
   database: typo
   pool: 5
   username: root
   password: '123456'

development:
   adapter: mysql2
   encoding: utf8
   database: typo_dev
   pool: 5
   username: root
   password: '123456''

rake RAILS_ENV=production db:create is successful
rake RAILS_ENV=production db:migrate failed in the executing. As ECHO3
in attachs::


Now this is interesting :-). It seems this fails with Ruby 1.9.2, whereas it 
works fine with Ruby 1.8.7.


I've made a patch that fixes this error (see attachment). You will have to 
re-create the database, so do a db:drop, db:create, db:migrate.


I will commit this patch to github as well.


Attachments:
http://www.ruby-forum.com/attachment/6069/typo_failed.txt


Regards,
--
Matijs
diff --git a/db/migrate/039_serialize_blog_attributes.rb b/db/migrate/039_serialize_blog_attributes.rb
index 87420b2..dd85472 100644
--- a/db/migrate/039_serialize_blog_attributes.rb
+++ b/db/migrate/039_serialize_blog_attributes.rb
@@ -106,13 +106,11 @@ class SerializeBlogAttributes  ActiveRecord::Migration
 BareSetting.transaction do
   BareBlog.find(:all).each do |blog|
 blog.settings = { }
-BareSetting.with_scope(:find = { :conditions = blog_id = #{blog.id}}) do
-  BareBlog.fields.each do |key, spec|
-next unless setting = BareSetting.find_by_name(key.to_s, :limit = 1)
-blog.settings[key.to_s] =
-  spec.normalize_value(setting)
-BareSetting.delete(setting.id)
-  end
+BareBlog.fields.each do |key, spec|
+  next unless setting = BareSetting.find_by_name_and_blog_id(key.to_s, blog.id, :limit = 1)
+  blog.settings[key.to_s] =
+spec.normalize_value(setting)
+  BareSetting.delete(setting.id)
 end
 blog.save
   end
___
Typo-list mailing list
Typo-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/typo-list

[typo] Installation typo6.0.4 failed on Ruby 1.9.2 and rails3.0.5

2011-03-23 Thread ken wang
I installed the sqlite3,and also copied the sqlite dll to ruby's bin
dir. Anyone can tell me what's wrong with my opeoration?
1 When using the default database.yml, and change the password to my
local paasword.
When exec bundle install, mysql 2.8.1 is installed.
Then exec rake RAILS_ENV=production db:create, return already exists as
ECHO1 in attachs:

2 I changed the configuration of database and gemfile. Replace all the
mysql to mysql2.
When exec bundle istall, it using the mysql2 (0.2.6)
When exec rake RAILS_ENV=production db:migrate, returns as ECHO2 in
attachs:


3 when change the database config as follows:
production:
  adapter: mysql2
  encoding: utf8
  database: typo
  pool: 5
  username: root
  password: '123456'

development:
  adapter: mysql2
  encoding: utf8
  database: typo_dev
  pool: 5
  username: root
  password: '123456''

rake RAILS_ENV=production db:create is successful
rake RAILS_ENV=production db:migrate failed in the executing. As ECHO3
in attachs::

Attachments:
http://www.ruby-forum.com/attachment/6069/typo_failed.txt


-- 
Posted via http://www.ruby-forum.com/.
___
Typo-list mailing list
Typo-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/typo-list