mysql - 按照 Sharetribe 安装说明进行操作并收到错误 "ERROR 1064 (42000): You have an error in your SQL syntax;"

标签 mysql ruby macos terminal

我对 Ruby 完全是个新手,但已经按照以下说明成功做到了这一点: 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

等等

最佳答案

感谢您尝试 Sharetribe!

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

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

关于mysql - 按照 Sharetribe 安装说明进行操作并收到错误 "ERROR 1064 (42000): You have an error in your SQL syntax;",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25420277/

相关文章:

objective-c - 如何使用界面生成器在 xcode 4 中设置 NSTableColumn 的标识符?

macos - Pycharm 安装失败并显示 "Invalid Log Path"

php - 如何根据我从客户端获得的 JSON 数组删除 mysql 记录?

php - 如何在一个表中显示多行,而在另一个表中的一行显示为单行

成功时 PHP 页面重定向,否则显示错误

javascript - 使用 Jquery/PHP/Mysql 更新编辑值

ruby - Watir ... sleep 和等待之间的区别

ruby-on-rails - 记录一个使用 Yard 呈现 JSON 的函数?

ruby-on-rails - 循环访问来自 Flickr 的 API 结果

macos - 在 Mac OSX 上使用 Xcode4 部署和分发 OpenCV 应用程序