While trying to install the MySQL gem in a Mac OS Lion, you might get an error message:
$ sudo gem install mysql -v '2.8.1'
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
....
*** 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.
To install Ruby and Rails on your Amazon EC2 server there are a few steps you need to follow, but none of them quite hard. By default ruby is already installed on your server by Amazon - check it by running $ ruby -v.
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-linux]
If you are running ruby in Mac OS X Lion and are having trouble with MySQL with the ever annoying message "uninitialized constant MysqlCompat::MysqlRes please do not spend the hours I did trying to solve it. Here is how to do it. The instructions below assume you have a 64 bits processor.
If you are attempting to execute the rails server by executing rails s or rails server and instead of having the server started you only get a folder named 'server' or the usage help message for the rails command, you are most probably running rails version 2.x.
For this version of rails you must use the command ruby script/server to start the server.
Have you just updated your rails version from 2.2.2 to 2.3.5 (or later) and you are getting the strange error message below?
uninitialized constant ApplicationController
This happens because the application controller is no longer called application.rb.
It is now know as application_controller.rb.
There is a rake task to do the renaming automatically for you. Simply run:
rake rails:update
If you are using RoR (Ruby on Rails) and Windows to develop you probably ran into this problem. You want to install a Plugin and use it in your application, so you find some tutorial or links anywhere on the big WWW and when you copy/paste the links they do not work and you get an error message telling you that this is not an executable file. Much like this:
C:\repository\ruby\project>script\plugin install git://github.com/dougal/daemon_generator.git
'script\plugin' is not recognized as an internal or external command, operable program or batch file.