jipiboily / spree_multi_lingual

Spree multi-lingual is a plugin to make multi locale store with Spree possible
BSD 3-Clause "New" or "Revised" License
49 stars 56 forks source link

problem with the installation #21

Closed umuthan closed 12 years ago

umuthan commented 12 years ago

hi i get a sytax error while installation : /Library/Ruby/Gems/1.8/gems/polyglot-0.3.3/lib/polyglot.rb:63:in polyglot_original_require': /Users/umuthanuyan/railsprojects/----/vendor/cache/spree_multi_lingual-86981bd6d407/lib/spree_multi_lingual/translates_with_accessors.rb:50: syntax error, unexpected ':', expecting kEND (SyntaxError) ... globalize_accessors locales: SpreeMultiLingual.languages, ... ^ /Users/umuthanuyan/railsprojects/----/vendor/cache/spree_multi_lingual-86981bd6d407/lib/spree_multi_lingual/translates_with_accessors.rb:50: syntax error, unexpected ':', expecting '=' ...Lingual.languages, attributes: params.to_a if accessors ^ from /Library/Ruby/Gems/1.8/gems/polyglot-0.3.3/lib/polyglot.rb:63:inrequire' from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:inload_dependency' from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in require' from /Users/umuthanuyan/railsprojects/----/vendor/cache/spree_multi_lingual-86981bd6d407/lib/spree_multi_lingual.rb:6 from /Library/Ruby/Gems/1.8/gems/bundler-1.2.0.rc/lib/bundler/runtime.rb:68:inrequire' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.0.rc/lib/bundler/runtime.rb:68:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.0.rc/lib/bundler/runtime.rb:66:ineach' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.0.rc/lib/bundler/runtime.rb:66:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.0.rc/lib/bundler/runtime.rb:55:ineach' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.0.rc/lib/bundler/runtime.rb:55:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.0.rc/lib/bundler.rb:128:inrequire' from /Users/umuthanuyan/railsprojects/----/config/application.rb:7 from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24:in require' from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24 from script/rails:6:inrequire' from script/rails:6

Davidslv commented 12 years ago

Hi,

Can you explain what have you done ? All the steps you have made are important to understand what gone wrong

umuthan commented 12 years ago

I just follow the steps that written on the README file.

first it give this error : "/Library/Ruby/Gems/1.8/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `polyglot_original_require': no such file to load -- easy_globalize3_accessors (LoadError)"

i google it and found this https://github.com/jipiboily/spree_multi_lingual/issues/11 then it solves my first problem.

Second time i got syntax error like i write in this issue.

Davidslv commented 12 years ago

Hi, are you using ruby 1.8.7 for some reason?

This is breaking because in this file (line 50) https://github.com/jipiboily/spree_multi_lingual/blob/master/lib/spree_multi_lingual/translates_with_accessors.rb#L50

The syntax is for ruby 1.9.3

The old way is :

:attributes => params.to_a if accessors

The new way

attributes: params.to_a if accessors

So, consider upgrade your ruby version to 1.9.3

umuthan commented 12 years ago

Yep i use ruby 1.8.7 :)

Now i updated to 1.9.3 but i get this error now :

  append  app/assets/javascripts/store/all.js
  append  app/assets/javascripts/admin/all.js
  insert  app/assets/stylesheets/store/all.css
  insert  app/assets/stylesheets/admin/all.css
     run  bundle exec rake railties:install:migrations FROM=spree_multi_lingual from "."

Would you like to run the migrations now? [Y/n] Y run bundle exec rake db:migrate from "." == AddTranslationTables: migrating =========================================== rake aborted! An error has occurred, all later migrations canceled:

uninitialized constant AddTranslationTables::Product

Tasks: TOP => db:migrate (See full trace by running task with --trace)

Davidslv commented 12 years ago

Hum.... wierd.

Open your db/migrate/ (file '_add_translation_to_product.spree_multi_lingual.rb')

This is what I have inside my file. What that error says is that is looking for the class AddTranslationTables::Product in my case it's AddTranslationToProduct, check it

# This migration comes from spree_multi_lingual (originally 20120213172418)
class AddTranslationToProduct < ActiveRecord::Migration
  def up
    Spree::Product.create_translation_table! :name => :string, :description => :text, :meta_description => :string, :meta_keywords => :string
  end
  def down
    Spree::Product.drop_translation_table!
  end  
end
umuthan commented 12 years ago

I have a lot of migration files inside db/migrate folder. I remove them then install spree_multi_lingual again.

It works :), thanks.

Davidslv commented 12 years ago

You're welcome, glad I could help