Friday, November 15, 2013

Errors and solutions encountered during diapora setup.(https://joindiaspora.com/)

Ref:http://rubydoc.info/gems/mysql2/0.3.13/frames
Error :
gem install mysql2 -v '0.3.13'

Solution :
tried below sequence

gem install  libmysqlclient-dev

gem install mysql2 -v '0.3.13'


Ref :http://stackoverflow.com/questions/16376010/ubuntu-cannot-install-rmagick

Error : Ubuntu - cannot install RMagick 

gem install rmagick -v '2.13.2'

Solution : 

tried below sequence

gem install apt-get install libmagickwand-dev

and then

gem install rmagick -v '2.13.2'


=======

http://railsvoice.wordpress.com/2010/11/01/rails-3-0-mysql-problem-in-dbcreate-and-dbmigrate/

I had installed Rails 3.0 on my Ruby 1.9.2 system and was trying out a new app. I had the mysql gem already installed into my system and hence since we know by default rails creates sqlite based database.yml. Hence forth while creating the file, I had to do the following changes
$rails new testmysqlapp -d mysql
This creates a mysql based app. however by default when you open the database.yml, you will see the adapter as mysql2 instead of mysql. I just changed from mysql2 to mysql
development:
adapter: mysql (changed from mysql)
encoding: utf8
database: testmysqlapp_development
pool: 5
username: root
password: 
host: localhost
Also if you look at the GEMFILE you will see gem ‘mysql’ already available.
Now the first thing you do is run bundle installer
$cd testmysqlapp
$bundle install
This will install all the gems that you want to use.  Next step is to create the database. Lets use the standard rake method
$rake db:create (sometimes this will give errors especially i have found it in rails 3.0.1).
So alternatively i have used
$rake -r mysql db:create
Everything works fine and the database is created. this generally creates the Test and Development databases. Alternatively you can also mention the environment as
$rake -r mysql db:create ENV=development
Similarly when you want to do the migration you can call the similar code
$rake -r mysql db:migrate ENV=development

 

=======

No comments:

Post a Comment