Ruby on Rails / MySQL error - mysql

I just upgraded my Mac to 10.9, Mavericks, and everything went downhill from there. I wish I could easily downgrade and go back. So, after days of troubleshooting, I finally got the rails server to run and I can see my app locally on localhost. But now I am getting a MySQL error (see below) when I try to run the "rails console" command:
/Users/myusername/.rvm/gems/ruby-2.0.0-p481/gems/mysql2-0.3.16/lib/mysql2/mysql2.bundle: [BUG] Segmentation fault
ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-darwin13.1.0]
Any advice / help on this one would be appreciated. Thanks in advance!

Related

How do I install Mysql with Macports

I am trying to connect a QT app to an SQL database, however keep getting an error with the qmysql driver not loading. Having spent a week now trying all possible solutions, the final solution was to try and install mysql using macports.
I am using a mac with OS Catalina.
I have installed MacPorts using the recommended pkg file.
I have confirmed installation using 'port version' with the following response 'Version: 2.6.2'
As per the instructions on the macports website I try to install using the following command:
$ sudo port install mysql8-server
I get the following error:
Error: Port mysql8-server not found
I have tried other ports listed on the macports website for mysql and all return the same error. Would greatly appreciate if anyone can point out where I might be going wrong and how to fix this issue.
Thanks in advance
For anyone who experiences this problem, following installation run a self update and refresh all of the ports. For some reason on a new install the ports are not updated.

Error loading MySQLdb module: /usr/lib64/libperconaserverclient.so.18: version `libperconaserverclient_16' not found

I'm suddenly getting the following error on my hosted Django website:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: /usr/lib64/libperconaserverclient.so.18: version `libperconaserverclient_16' not found (required by /home1/reconess/python/lib/python2.7/site-packages/_mysql.so)
The site was working fine last week, then this week (with no changes made by us), we're getting that error. I'm thinking it might be a change to the MySQL setup done by the host (perhaps some update to Percona?), but given that I have very little idea of what Percona is, let alone how Django, MySQL, and Percona interact I'm having some problems figuring out what's gone wrong and how to fix it.
The file /usr/lib64/libperconaserverclient.so.18 definitely exists.
Thanks for any help.
Same thing happened to me today on a shared server with BlueHost. The following command did the trick.
pip3.5 install --upgrade mysqlclient
I just looked at your full error message and noticed you are running python2.7, so your call to pip might be slightly different.

Chef server error on create user (/etc/opscode/pivotal.rb does not exist)

I am extremely new to chef and I am attempting to create a chef server running on a Digital Ocean Ubuntu 14.04 droplet. I am using this guide for the install. I download the .deb and installed it fine. I then run chef-server-ctl reconfigure which runs without an issue. When I go to create my user I enter in all the details and run it, it then waits a few seconds and returns the error ERROR: CONFIGURATION ERROR:Specified config file /etc/opscode/pivotal.rb does not exist
I have scoured the internet to try and find a fix but haven't been able to find a thing. I have also tried doing these exact steps on a VPS running Ubuntu 12.04.5 and getting identical results.
For /etc/opscode/pivotal.pem is missing error use following command.
cp /opt/opscode/embedded/service/omnibus-ctl/spec/fixtures/pivotal.pem /etc/opscode/
Ran into the same thing when trying to install chef in an VM.
Expanding the memory (from 512Mb to 1512Mb) and reran reconfigure solved it for me.
Same problem here. An older version, for example 12.03 of chef-server works for me with Ubuntu 14.04
I got this error because my /etc/opscode/chef-server.rb had a syntax error.
The syntax error was displayed earlier in the logs, however my install script has kept going, causing later on this error.
More than likely, you have forgotten to run chef-server-ctl reconfigure. It's ambiguous naming of the command as it's reconfigure, however the installation guide for Chef Server actually states to run it after installing the package.
Why it's not part of the installation process is beyond me.
I had this problem as well. I exited my ssh session to the node I was configuring. I connected again and ran chef-server-ctl reconfigure again. I was able to then create a user without the error. I was using chef-server-core_12.1.0-1_amd64.deb for my install.
I got the same error with Ubuntu trusty 14.04 64 bit
/etc/opscode/pivotal.rb does not exist. I followed what Matthias Said and destroyed my VM ( I'm using Vagrant), then I quickly set up the VM and installed Chef server 12.03. I can now set up users correctly.
Just an FYI I also tried to install the latest version of chef which is 12.2.0 and do this but I also ran into the same error when trying to provision a user account.
Downgrading to 12.03 solved it for me.
I run in the same issue on CentOS 7 and Chef Infra Server 12.19.31; the following steps helped me to get the root cause of the problem.
Re-run the chef-server-ctl reconfigure and check if it gives any error at the end of the run
In my case, I received the error
Chef Client failed. 0 resources updated in 02 minutes 19 seconds
Check the stack trace / output log on
/var/opt/opscode/local-mode-cache/chef-stacktrace.out
I received
Errno::ENOMEM: Cannot allocate memory - ls -1 /opt/opscode/embedded/service/oc_id/db/migrate | tail -n 1 | sed -e "s/_.*//g"
To solve the problem, I upgraded the system with higher memory.
TL;DR;
Rerun the chef-server-ctl reconfigure to get the error
Upgrade the allocated memory to solve the issue
Me too got this error while installing chef infra server pkg in centos 8.
"ERROR: CONFIGURATION ERROR: Specified config file /etc/opscode/pivotal.rb does not exist"
Post Memory up-gradation I re-run below cmd its fixed issue:
sudo chef-server-ctl reconfigure

Ruby on Rails application could not be started (mysql error 2002)

I got a OSX Server, i updated it to 10.6.5 from 10.6.4.
Since then my Ruby on Rails Application (leihs) gibes me an Error.
"your config/databse.yml may not be written correctly. Please check it and fix any errors.
Your databse schema may be out of date or nonexistant. ....
The database server may not be running. Please check whether it's running, and start if it isn't
Error message:
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) (Mysql:error)
Then a looong list of backtraces whitch dont really help me.
The Socket file does NOT exist, and i cant find it on other places.
Please help me, this is making me crazy.
Thanks for your time & help
I appears that your mysql server is not running. You should debug that portion of your system before looking at your rails app.
A few things to checK:
Can you connect from the command line?
Are there startup errors in your mysql log file?
Did you change IP addresses, share names or anything else that might have stuffed your mysql install?
I solved the Problem!
Reinstalling the 10.6.5 Combo Update helped.
-Download the correct Combo Update (same version (server/normal), same build)
-Stop the Services (like Web and so on..)
-Install the Update
-Restart
-Start Services
-All should work again
Thanks to all of you guys for their help.

MySQL server has gone away: Rails on Passenger (Redmine)

I am making use of Redmine a web based software tracking tool, its perfect for my needs. However, I keep coming across this error in my production.log.
ActiveRecord::StatementInvalid
(Mysql::Error: MySQL server has gone
away: SELECT * FROM issue_relations
WHERE (issue_relations.issue_from_id
= 6) ): app/models/issue.rb:234:in after_save'
app/controllers/issues_controller.rb:196:in
edit'
When I add a ticket or update a ticket I get the below error and the above is recorded in my logs. It returns this via the browser after about 15 seconds. I have tried it several times, other areas of the app work fine.
Internal error
An error occurred on the page you were
trying to access. If you continue to
experience problems please contact
your redMine administrator for
assistance.
Back
I am using Ruby on Rails 2.3.8 on Phusion Passenger. Gem version 1.3.7. Active record 2.3.8. mysql (2.8.1 ruby x86-mingw32 x86-mswin32, 2.7.3 mswin32).
I am not a Ruby on Rails programmer and I am at loss on what else I can do to narrow this down. I had quick Google and found that as of rails 2.3 there is an option to reconnect so in my database.yml file I placed a reconnect true, but this didn't help!
Thanks all for any help
The list of usual suspects: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html (all checkable on the MySQL-side of things).
Try putting the code from this Gist in a file in {rails application}/config/initializers/active_record_connections.rb: http://gist.github.com/238999
That said, this should probably not be happening in the first place - and if requests are taking 15 seconds to load, that also suggests that something else is going on. Can you share what appears in the logs before this error?