I have a problem similar to the one outlined at uninitialized constant MysqlCompat::MysqlRes (using mms2r gem)
Trying to run a Rails 2.3.14 application under passenger 3.0.9 with the mysql 2.8.1 gem on Snow Leopard I get an error:
uninitialized constant MysqlCompat::MysqlRes
However, this ONLY happens under passenger, I can interact with mysql through ActiveRecord through all other means: i.e. I can create models in script/console, rake db:migrate, tests and so on. The mysql gem has been built with with the correct ARCHFLAGS. Both ruby and mysql have been built 64 bit.
Other information: I'm using RVM, REE and bundler.
Turns out that this was caused by using the DYLD_LIBRARY_PATH environment variable to overcome the problem in the mysql 2.8.1 gem. This wasn't part of the apache environment, but was part of any user process spawned from the shell, hence it not working under apache.
Related
My friend has a mac - we got AMPPS set up so he can run Apache, PHP and MySQL.
We got it up running. I can talk to mysql using phpMyAdmin.
I am running codeigniter - its working fine - but I'm getting an error when it tries connect to the database
Fatal error: Call to undefined function mysqli_init() in
mysqli_driver.php on line 126
I have a feeling that I'm missing the mysql.so extension or module in the Apache install or the PHP install.
How do I install that on a mac, or which config file do I need to modify?
That error indicates that the mysqli.so module is not loaded. Check the results of phpinfo() to see where the configuration file is, and make sure the module's being included properly. Often times there is a separate ini file for each module that's separately installed.
Personally I'd stay away from mysqli and use something higher level like PDO. I'd also recommend installing something maintainable like MacPorts or Homebrew to run Apache/MySQL/PHP instead of a pre-packaged solution.
I am trying to run the command rails server in the folder where is my ruby application but is failing. I am using the followig versions:
Ruby 1.9.3.
Gem 2.0.3.
Rails 4.2.1.
MySQL server 5.5
Someone know how can I fix it?
We've established a connection to appfog using caldecott and af tunnel command. We try to connect to a mysql service to load and execute a big .sql file to populate the db.
We tried it from 3 different machines Ubuntu on VirtualBox, Feora 18 on VirtualBox and native Ubuntu. We also tried it on another account, but we keep getting this error:
Launching 'mysql --protocol=TCP --host=localhost --port=10000 --user=uZVQhGhbYEzyb --password=pNu1l6xbXVhbj d39d6d0e6344b41a4aaeada16dfca2a46'
terminate called after throwing an instance of 'std::runtime_error'
what(): Encryption not available on this event-machine
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Aborted (core dumped)
Thanks to appfog customer support I managed to solve this problem. My distro lacked an ssl provider.
To solve this on fedora
yum install openssl openssl-devel
gem uninstall eventmachine
gem install eventmachine
However I still had a problem with executing big sql scripts. Does anyone know a neat solution to this issue?
For a Windows system, I got it to run by doing the following:
Install Win32 OpenSSL v1.0.1e Light from here
Install Visual C++ 2008 Redistributables from the same link if not already installed.
Re-install eventmachine in Ruby with the newly installed open-ssl.
gem install eventmachine -- --with-ssl-dir=C:\OpenSSL-Win32
(you might need C:\OpenSSL-Win32\bin)
After the installation is complete, you're ready to tunnel to any service! (In my case postgresql)
I'm trying to start a rails application in my server. but i'm getting this error.
uninitialized constant MysqlCompat::MysqlRes
The rails version is 2.3.14 and ruby 1.8
Anybody know how to get this working?
So I was making some tests here on Rails and for first time I decide to use MySQL, I've setting up the gem mysql2 and the mysql server.
When I try to access the database I receive this:
ActiveRecord::ConnectionNotEstablished
The strange thing is I'm able to run the rake db:create and the migrations without any problems.
thanks in advance,
Renan
ActiveRecord::ConnectionNotEstablished
Raised when connection to the database could not been established (for example when connection= is given a nil object).
Try checking your db configurations in the config/database.yml file if everything is correct or not!!