我对Rails游戏相当陌生;我是一位教我自己编程的前端开发人员。我已经构建了一个Web应用程序,并决定使用RailsKit SaaS工具包来处理我的注册等。我有问题只是让默认的应用程序启动并运行,但我确信这是由于我缺乏知识,我认为这与设置mysql服务器有关(通常我使用sqlite3,但这并不是' t似乎也适用于这个应用程序)。让RailsKits SaaS应用启动并运行w/mysql2服务器
具体的过程和我遇到的错误,我仍然不能甚至创建一个数据库或启动服务器...
下载应用程序
Ran
bundle install
。得到了以下错误: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中:
gem 'rake','1.9.2' and **updated my system** to 1.9.2
然
bundle install
,得到了出现以下错误: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
并得到了以下错误: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
创建一个数据库,并得到了
Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine.
所以我猜MySQL是没有安装在我的机器上?似乎有点奇怪的原因,我一直使用MAMP的MySQL服务器。
任何帮助指引我在正确的方向将是伟大的家伙!对此,我真的非常感激。
您正在使用哪个操作系统安装宝石mysql2?对于OSX看到这个答案:http://stackoverflow.com/questions/4115126/ruby-gem-mysql2-install-failing – doesterr
OSX。我虽然过去了,现在可以启动服务器。迁移时出现此错误: 'Trevan-Hetzels-MacBook-Pro:V4 trevanhetzel $ rake db:create db:migrate saas:bootstrap rake aborted! 未定义的方法'trial_interval'为# /Users/trevanhetzel/.rvm/gems/ruby-1.9.3-p327/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407: in'method_missing' /Users/trevanhetzel/.rvm/gems/ruby-1.9。3-p327/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:在'... –
此问题是由于Kit随附的迁移中缺少字段。这已被修复。 :) –