Today I was trying to install Redmine on my shared hosting following this guide:
http://unixserveradmin.com/archives/691
But i got stuck installing the mysql gem.
[trebolbi@air6 ~]$ gem install mysql -with-mysql-config=/user/bin/mysql_config
Fetching: mysql-2.8.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-mysql-config
--without-mysql-config
Gem files will remain installed in /home/trebolbi/th-mysql-config=/user/bin/mysql_config/gems/mysql-2.8.1 for inspection.
Results logged to /home/trebolbi/th-mysql-config=/user/bin/mysql_config/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
The problem is bigger yet, because there are 2 installations on my server, one in my local home folder, and one in the server’s bin folder.
That makes the commands doesnt execute without error.
For example, for this step:
- Log into the SSH, run “rake gems:install” from the Ruby Apps path
I get this error…
[trebolbi@air6 RedMine]$ rake gems:install
/usr/bin/rake:16:in `load': no such file to load -- rake (LoadError)
from /usr/bin/rake:16
And if i try executing the command using my local installation:
[trebolbi@air6 RedMine]$ ./../../ruby/gems/bin/rake gems:install
I get a lot of errors, all related to “Gem::SourceIndex#add_spec called from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.” … as you can see, it looks for the gems in the server bin directoy (/usr/local/bin) and not in my local user installation of ruby (/home/user/ruby/gems/bin).
I just have to execute this commands to get the installation done…
gem install mysql
cd /home/trebolbi/rails_apps/RedMine
rake gems:install
rake generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
And i want to execute them from my account and with my local ruby installation, but i get all those errors… what am I doing wrong?
Firtsly, check if your ruby version (
$ ruby -v) is fully compatible with the Redmine. You can check the compatiblity RedmineInstall – this will not solve your current problems, but may help avoid others further.According to gem installation problem, you should install mysql header files, the gem tool wrote that mysql.h was not found. You can do this if you have privileges to instaling software on your server. If you are, use your package manager (
yum,apt-get,pacman– depends on your OS), just install the mysql development package (may be named likelibmysqlormysql-devel, google it for your os). If you don’t have privileges on installing software, write an inquiry to support asking to install mysql development libraries.For solving rake problem, try to use bundler gem. You can find more information about it there: http://gembundler.com/ . After adding all needed records to the Gemfile, where you probably would like to include rake, mysql, and maybe some other gems, run
bundle install. After all that operations you can safely runbundle exec raketo execute exactly the gem from bundler.Let me know if you have any questions.