【问题标题】:Following Sharetribe install instructions and getting error "ERROR 1064 (42000): You have an error in your SQL syntax;"遵循 Sharetribe 安装说明并收到错误“ERROR 1064 (42000): You have an error in your SQL syntax;”
【发布时间】:2014-10-14 17:30:21
【问题描述】:

我是 Ruby 的一个完整的 nubie,但按照以下说明成功地做到了这一点: https://github.com/sharetribe/sharetribe

但是将此代码直接复制/粘贴到终端会导致错误。有什么想法吗?

c = Community.create(:name => "your_chosen_name_here", :domain => "your_chosen_subdomain_here")

tt = c.transaction_types.create(:type => "Sell",
 :price_field => 1,
 :price_quantity_placeholder => nil);

tt_trans = TransactionTypeTranslation.create(:transaction_type_id => tt.id,
 :locale => "en",
 :name => "Sell",
 :action_button_label => "Buy");
ca = c.categories.create;
ca_trans = CategoryTranslation.create(:category_id => ca.id,
 :locale => "en",
  :name => "Items");
CategoryTransactionType.create(:category_id => ca.id, :transaction_type_id => tt.id)

错误是:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'c = Community.create(:name => "marketfarm", :domain => "marketfarm")
c = Communi' at line 1

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tt_trans = TransactionTypeTranslation.create(:transaction_type_id => tt.id,
 :lo' at line 1

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ca = c.categories.create' at line 1

等等

【问题讨论】:

    标签: mysql ruby macos terminal


    【解决方案1】:

    感谢您试用 Sharetribe!

    首先,我们更新了安装说明。新的安装说明不需要此步骤。

    在你的情况下,我猜那里存在某种复制/粘贴错误。也许您可以尝试首先将命令复制/粘贴到文本编辑器(即记事本)并删除换行符并使命令成为单行。我注意到有时控制台不理解多行粘贴命令。

    【讨论】:

      【解决方案2】:

      我猜你正在使用除 Mysql 之外的任何其他数据库,如 sqlite 或 postgresql。 Sharetribe 只支持 Mysql 数据库。

      谢谢

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-09-14
        • 2015-11-14
        • 2012-11-20
        • 1970-01-01
        • 2020-10-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多