28868

Getting the RailsKits SaaS app up and running w/ a mysql2 server

Question:

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 <a href="http://railskits.com/saas/" rel="nofollow">RailsKit SaaS</a> 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...

<ol><li>

<strong>Downloaded the app</strong>

</li> <li>

<strong>Ran bundle install.</strong> 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. </li> <li>

<strong>Found out I was running on Ruby version 1.8.7</strong>, so I added this to the Gemfile:

gem 'rake','1.9.2' and **updated my system** to 1.9.2 </li> <li>

<strong>Ran bundle install</strong> 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. </li> <li>

<strong>So I ran gem install mysql2 -v '0.3.11</strong> 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. </li> </ol>

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.

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.

Answer1:

bundle exec rake db:migrate it sounds like.

Answer2:

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

After this try to install gem mysql2

Recommend

  • 500 internal server error in ruby on rails
  • Including data files with setup.py
  • Creating new docker-machine instance always fails validating certs using openstack driver
  • Aspect advising other aspects
  • Can't get LogCat (Alcatel OneTouch Evolve)
  • Defining variable by logical subseting on time interval in data.table
  • scrollOverflow not working in fullPage.js
  • Partial specialization of a class template in derived class affects base class
  • How do I capture a rsolr Sunspot exception raised on a different thread from a model callback?
  • Is there a way to choose which files are displayed to the user via the standard OPENFILE dialogs?
  • Merge Module leaving files during uninstall
  • python: forcing relative imports to search from script file
  • SSL client cert authentication for only some URLs?
  • Installing Perl6 and Panda on Ubuntu 15.10. Problems with bootstrap.pl
  • VSCode change debug shell to bash on windows
  • How to get listview position?
  • OSX - always hide certain files
  • Compiling dlib on OS X
  • Undefined references when compiling gSOAP client
  • How to generate and display a QR Code in ionic 2
  • Using JRuby with Rails 3.2
  • Firefox Extension - Monitor refresh and change of tab
  • Connect .sks to skscene.h
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • How to test if a URL from an Eclipse bundle is a directory?
  • Is it possible to access block's scope in method?
  • why do I get the error when installing the gem 'pg'? [duplicate]
  • Master page gives error
  • RectangularRangeIndicator format like triangular using dojo
  • Deserializing XML into class C#
  • Google cloud sdk not working when python points python3
  • Cannot Parse HTML Data Using Android / JSOUP
  • How to include full .NET prerequisite for Wix Burn installer
  • Does armcc optimizes non-volatile variables with -O0?
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize