使用MySQL2服务器启动和运行RailsKits SaaS应用程序 [英] Getting the RailsKits SaaS app up and running w/ a mysql2 server

查看:96
本文介绍了使用MySQL2服务器启动和运行RailsKits SaaS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Rails游戏还很陌生;我是一名前端开发人员,自学编程。我已经构建了一个网络应用程序,并决定使用 RailsKit SaaS 套件来处理我的注册等。我在启动和运行默认应用程序时遇到了问题,但是我敢肯定这是由于我缺乏知识,我认为这与设置mysql服务器有关(通常我使用sqlite3,但事实并非如此)。

I'm fairly new to the Rails game; I'm a front-end dev teaching myself to program. I've built a web application and decided to use the RailsKit SaaS kit to handle my registrations and such. I'm having problems just getting the default app up and running, but I'm sure it's due to my lack of knowledge and I think it has to do with getting a mysql server set up (usually I use sqlite3, but that doesn't seem to work w/ this app either).

这是我遇到的过程和错误,我什至无法创建数据库或启动服务器...

Here's the process and errors that I've come across, and I still can't even create a db or start the server...


  1. 下载了应用程序

Ran 捆绑安装出现以下错误:

Ran bundle install. Got the following error:

Gem::InstallError: factory_girl requires Ruby version >= 1.9.2. 
An error occurred while installing factory_girl (4.1.0), and Bundler cannot continue.
Make sure that `gem install factory_girl -v '4.1.0'` succeeds before bundling.


  • 发现我在Ruby 1.8.7版上运行 ,因此我将其添加到了Gemfile中:

  • Found out I was running on Ruby version 1.8.7, so I added this to the Gemfile:

    gem 'rake','1.9.2' and **updated my system** to 1.9.2
    


  • Ran 捆绑安装 ,并收到以下错误:

  • Ran bundle install and got the following error:

    An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
    Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
    


  • 所以我运行了 gem install mysql2 -v' 0.3.11 ,并收到以下错误:

  • So I ran gem install mysql2 -v '0.3.11 and got the following error:

    ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.
    
    /Users/trevanhetzel/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
    checking for rb_thread_blocking_region()... yes
    checking for rb_wait_for_single_fd()... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lm... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lz... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lsocket... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lnsl... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lmygcc... no
    checking for mysql_query() in -lmysqlclient... no
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.
    


  • 这就是我的位置。如果这样做有帮助,经过上述所有步骤,我尝试通过 rake db:create 创建一个数据库,并得到

    So that's where I am. If this helps, after all the steps above, I tried to create a db by rake db:create and got

    Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine.
    

    所以我猜我的机器上没有安装MySQL?似乎有点奇怪,原因是我一直在使用MAMP和MySQL服务器。

    So I'm guessing MySQL is not installed on my machine? Seems kinda odd cause I use MAMP all the time w/ a MySQL server.

    向我指出正确方向的任何帮助都是好人!

    Any help pointing me in the right direction would be great guys! I really appreciate it.

    推荐答案

    在安装mysql2 gem之前,您需要在系统中安装mysql客户端和服务器。所以试试这个。

    Before installing mysql2 gem you need to install mysql client and server in your system. So try this.

      $sudo apt-get update
      $sudo apt-get install mysql-server mysql-client
    

    在此之后,尝试安装gem mysql2

    After this try to install gem mysql2

    这篇关于使用MySQL2服务器启动和运行RailsKits SaaS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆