From Winxp to Win7 Need to reinstall all the Rails gems? - mysql

I've switched from a winxp box to a new win7 64bit box and i want to get my rails development project running on it. i can copy my project folder to the new box and now i want to migrate all the gems that i used on my winxp to the win7.
do i need to "gem install" all the gems again on the win7? or i can hv an easier way to do it? pls give details on how to do it.
i want to migrate my schema.rb to the newly installed mysql on the win7. how to do it? i installed aptana studio 3 but the rake and generator functions are no longer available.
thanks
batterhead

1) Do you have Gemfile? If so, just run bundle update command at your project's directory.
2) Run rake db:migrate at your project's directory (assuming you already updated a configuration file)
HTH

Related

Problem upgrading from mysql 5.7 to 8.0 in a rails app - missing mysql.so files

I upgraded a working Rails app from Mysql 5.7 to 8.0 on my dev machine but it fails to work on a staging/test server setup with the exact same directory structure and env vars.
I'm getting an error "file not found" for /apps/bundle/ruby/2.7.0/gems/mysql2-0.5.4/lib/mysql2/mysql2.so
ldd /apps/bundle/ruby/2.7.0/gems/mysql2-0.5.4/lib/mysql2/mysql2.so shows a file not found (mysql.so.20) (? - I'm not at work so the filenames might be off) that definitely existed and was part of Mysql 5.7.
So the overall question is how to force the mysql2 gem install to relink to the correct new .so files?
There are a lot of moving parts to this, making things a mystery:
installing mysql from a source tarball,
installing in non-standard directories (apps/usr/local/stow/mysql-8.0.16),
using GNU stow to link mysql .so files from the install directory apps/usr/local/stow/mysql-8.0.16 into a common /apps/usr/local/lib directory (the env var LD_LIBRARY_PATH=/apps/usr/local/lib),
vendoring the gems in the bundle on my dev machine using the bundle package --all command so they're part of the git repo.
I've blown away the /apps/bundle directory contents and rerun bundle install thinking that would force a proper linkage of the .so files without success.
Any ideas? TIA!

Mysql and Ruby on Rails configuration in windows7 x86

I install the RailsInstaller downloading from this site http://railsinstaller.org/ and also install the mysqlInstaller downloading from this site http://dev.mysql.com/downloads/. Both I have installed in c:\ drive. I have also installed mysql driver from ruby command gem install mysql. Now I haven't Idea how to configure mysql in Ruby on Rails.
I have seen this answer MySQL driver for Rails in Windows 7 x64 they tell to replace libmySQL.dll but where to replace I didn't find such file.
Does anyone have any Idea or solution about my problem?
I had same problem. following solution worked for me
Solution:
the libmysql.dll file is located in the bin directory of your mysql installation.
This file needs to be a copy of it in the Ruby\bin directory.

How to install Ruby on Rails with mysql and get it working, a step by step guide?

Some time ago I managed to get RoR working on Windows XP.
I've been trying to get it working on Windows 7 for 2 days but there's just no way, there's always a problem, one that google can't answer, no matter what I try.
Can someone give me a guide or something to get it working on Windows 7 or XP ? Even Ubuntu but I'd rather not go through that maze again.
I figure I'm going to install Windows XP on a virtual machine and start from there.
I need RoR and mysql - what versions, where do I download them from and what steps do I take ?
On a side note, how do you install mysql2 (version < 0.3) on rails 3.0.7 ? Because it automatically tries something over 0.3 which doesn't work on rails 3.0.7 and if I try the gemfile bundle trick with 0.2.7 I don't know how to specify configuration options and of course it doesn't work if I don't give it the location of mysql lib and include directories.
Also I tried using rails 3.1 beta and everything goes smoothly until I start the server and the website never loads on localhost:3000.
This is basically what I do to install on Windows 7:
Download and install latest mysql from http://dev.mysql.com/downloads/mysql/
Install Ruby http://rubyinstaller.org/downloads/ (check the box to update PATH)
Install Ruby Devkit http://rubyinstaller.org/downloads/ (for example extract to C:\DevKit)
Setup Devkit
cd [MY_DEVKIT_INSTALL_DIR]
ruby dk.rb init
ruby dk.rb install
Copy libmysql.dll from your mysql/bin install to C:\Ruby192\bin
gem install rails
gem install mysql2 -v 0.2.6
rails new my_test_app -d mysql
To setup Rails on windows, just download and click:
http://railsinstaller.org/
Take a look at http://rubyinstaller.org/ it should get you up and running.
I like Aptana Studio 3 for developping with RoR on Windows 7. The book "Agile Web Development with Rails" is also full of good advices.
Here are the steps I followed:
1- Installing Ruby via RubyInstaller
2- Install MySQL (follow #Reuben Mallaby instructions)
3- Install Rails
With the Built-in Terminal, make dev' easy. You should take a look: Aptana Studio

mysql 5.5.9 -- install in windows

I just downloaded zipped-up version of mysql 5.5.9 (mysql-5.5.9.zip, which I put in c:\progream files), unzipped it, and got this dir (screenshot):
http://mayacove.com/misc/ss_mysql.gif
I hadn't installed mysql server on windows in a few years.. I remember that years ago you used to get an installer called setup.exe, when you ran that it ran instal/config wizard, that would walk you thru installation and setup.. so how do I run that wizard now???
no file with ext .exe inside this dir (no file with ext .msi either) no serious instructions here
http://dev.mysql.com/doc/refman/5.5/en/windows-installation-layout.html
would appreciate some help.. thank you very much...
There is a package available with a MSI installer.
Just follow the instructions on http://dev.mysql.com/downloads/mysql/
You should use msi installer. It's on download page first or second option.

Error when running Rails Server on a local copy: Could not find mysql2-0.2.6 in any of the sources. Try running `bundle install`

I just forked a copy of an app on github and saved it on my computer. When I attempt to run the rails server in the application directory, I get the following error:
Could not find mysql2-0.2.6 in any of the sources
Try running `bundle install`.
Earlier today, however, I installed MySQL 5.1.53 for Mac OS X and supposedly installed it...at least I'm quite certain I did.
Why does terminal come up with this error message even though I'm quite certain I have MySQL already installed on my system?
It's not complaining about MySQL itself, it's complaining about the missing gem.
Just do what the message says, run a bundle install to download and install the gem.