Cant run rails server on ubuntu - mysql

I am working on ruby on rails,
I have made a project using
rails new proj -d mysql
and then I type
rails server
but get this error, whats the problem
/home/mani/.rvm/gems/ruby-2.1.2/gems/execjs-2.2.1/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/mani/.rvm/gems/ruby-2.1.2/gems/execjs-2.2.1/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/execjs-2.2.1/lib/execjs.rb:4:in `<top (required)>'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/uglifier-2.5.3/lib/uglifier.rb:3:in `require'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/uglifier-2.5.3/lib/uglifier.rb:3:in `<top (required)>'
from /home/mani/.rvm/gems/ruby-2.1.2#global/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:in `require'
from /home/mani/.rvm/gems/ruby-2.1.2#global/gems/bundler-1.7.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/mani/.rvm/gems/ruby-2.1.2#global/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:in `each'
from /home/mani/.rvm/gems/ruby-2.1.2#global/gems/bundler-1.7.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/mani/.rvm/gems/ruby-2.1.2#global/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:in `each'
from /home/mani/.rvm/gems/ruby-2.1.2#global/gems/bundler-1.7.2/lib/bundler/runtime.rb:61:in `require'
from /home/mani/.rvm/gems/ruby-2.1.2#global/gems/bundler-1.7.2/lib/bundler.rb:133:in `require'
from /home/mani/Sites/proj/config/application.rb:7:in `<top (required)>'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `require'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `server'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands.rb:17:in `<top (required)>'
from /home/mani/Sites/proj/bin/rails:8:in `require'
from /home/mani/Sites/proj/bin/rails:8:in `<top (required)>'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /home/mani/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/mani/Sites/proj/bin/spring:16:in `require'
from /home/mani/Sites/proj/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

Add following gems in your Gemfile:
gem 'execjs'
gem 'therubyracer'
Run bundle install and now try to start rails server rails s

You can do this on your system
sudo apt-get install nodejs

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison nodejs subversion
Then restart your machine.

Related

Rake aborted! cannot load such file -- arel/visitor/mysql

When I try to run Rake (also with Rails commands) commands I got this error :
Rake aborted! cannot load such file -- arel/visitor/mysql
/config/application.rb:7:in <top (required)>
/Rakefile:4:in 'require_relative'
MySql database works perfectly, and I've added gem 'mysql2' in Gemfile.
Using --trace argument :
rake aborted!
LoadError: cannot load such file -- arel/visitors/mysql
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/arel/visitors.rb:8:in `<top (required)>'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/arel.rb:17:in `<top (required)>'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record.rb:29:in `<top (required)>'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/railtie.rb:3:in `<top (required)>'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/home/sneffar/working-dir/permission/config/application.rb:7:in `<top (required)>'
/home/sneffar/working-dir/permission/Rakefile:4:in `require_relative'
/home/sneffar/working-dir/permission/Rakefile:4:in `<top (required)>'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/home/sneffar/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/home/sneffar/.rbenv/versions/2.6.6/bin/rake:23:in `load'
/home/sneffar/.rbenv/versions/2.6.6/bin/rake:23:in `<main>'
Ruby --version : 2.6.6
Rails --version : 6.0.3.1
Rake --version: 13.0.1
I think you should remove arel:
gem uninstall arel
After that run:
bundle install
This should fix problem.
I also faced with this and agree with Nezir.
I believe that in my case, this happened because of such actions:
MySQL 5.7.30 -> MySQL 8.0.20 -> MySQL 5.7.30
The first time I had MySQL 5.7.30 it was fine with
bundle exec rake db:create db:structure:load
I faced this error while working with a legacy application, and here is the solution which worked for me. Hope this will work for you.
https://gist.github.com/SahSantoshh/fffbfbaa91f82b46ef8aa39922ee889e
Uninstall ruby
reinstall ruby
if db is running then It's fine if not, then run MySQL 5.7 using docker https://gist.github.com/SahSantoshh/8ff41ce4dd57305358e98d43adff76b1
hit bundle
run rake db:migrate

`jekyll serve` causing Load errors in console. Unable to start jekyll server locally

I'm trying to run a locally Jekyll server to check my side but after the run: jekyll serve command, I get:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/yaml.rb:5:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': incompatible library version - /usr/local/rvm/gems/ruby-2.3.1/gems/psych-2.2.2/lib/psych.bundle (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /usr/local/rvm/gems/ruby-2.3.1/gems/psych-2.2.2/lib/psych.rb:8:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/yaml.rb:6:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
from /usr/local/rvm/gems/ruby-2.3.1/gems/safe_yaml-1.0.4/lib/safe_yaml/load.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/local/rvm/gems/ruby-2.3.1/gems/jekyll-3.5.2/lib/jekyll.rb:29:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/local/rvm/gems/ruby-2.3.1/gems/jekyll-3.5.2/exe/jekyll:6:in `<top (required)>'
from /usr/local/bin/jekyll:26:in `load'
from /usr/local/bin/jekyll:26:in `<main>'
Check first if you can install libyaml:
on MacOS
or on Linux
Then gem install psych
Check out also rbenv/ruby-build issue 1251 and the GEM_HOME setting.

Secret generation in Redmine installation fails with error in json

I am trying to install redmine-3.4.2 on CentOS Linux release 7.3.1611 (Core)
Downloaded and extracted redmine-3.4.2 created database.yml & configuration.yml
Installed ruby & dependence using
yum install -y gcc-c++ rubygems ruby-devel ImageMagick-devel ImageMagick
Then done successfully completed gem install bundler and bundle install --without development test
Finally getting error while running bundle exec rake generate_secret_token with RAILS_ENV=production REDMINE_LANG=en
My Ruby gem version as follows:-
Ruby : ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
Gem : 2.0.14.1
Rails : Rails 4.2.8
bundle exec rake generate_secret_token --trace
rake aborted!
LoadError: cannot load such file -- json
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object/json.rb:2:in 'require'
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object/json.rb:2:in '<top (required)>'
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:12:in `require'
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:12:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/engine.rb:1:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/engine.rb:1:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/application.rb:7:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/application.rb:7:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails.rb:11:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails.rb:11:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/all.rb:1:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/all.rb:1:in `<top (required)>'
/opt/APPS/redmine-3.4.2/config/application.rb:3:in `require'
/opt/APPS/redmine-3.4.2/config/application.rb:3:in `<top (required)>'
/opt/APPS/redmine-3.4.2/Rakefile:5:in `require'
/opt/APPS/redmine-3.4.2/Rakefile:5:in `<top (required)>'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/usr/local/share/gems/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:27:in `run'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli.rb:362:in `exec'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli.rb:22:in `dispatch'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli.rb:13:in `start'
/usr/local/share/gems/gems/bundler-1.15.4/exe/bundle:30:in `block in <top (required)>'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/usr/local/share/gems/gems/bundler-1.15.4/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Thanks in Advance
Resolved by adding a Gemfile.local inside redmine directory
# Gemfile.local
gem 'multi_json'
gem 'json'
then run bundle lock --add-platform x86_64-linux (get your platform from ruby -v)
followed by bundle install --without development test

Rails 4.2.1 trouble starting WEBrick (mysql / windows)

I'm just starting out with Rails and am following the Ruby on Rails essential training course and get problems trying to start WEBrick. Assuming it has something to do with my installation of mysql but not sure.
I made sure that I am in the correct directory (:C\sites\simple_cms)
I ran 'bundle install' before running 'rails s'
I followed these guides to get the gem installed (second to last entry): https://github.com/brianmario/mysql2/issues/372
I have ruby 2.2.1p85, rails 4.2.1 and this rubygem: mysql2-0.3.18-x64-mingw32 installed
Would appreciate some help from y'all :)
Stack trace:
C:\Sites\simple_cms>rails s
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler.rb:134:in `require'
from C:/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

Problems with redmine installing step 5. rake generate_secret_token

I'm trying to install Redmine on my fedora machine and I have been following the official wiki to install it, I have gotten up to step 5 when I am asked to run the
*rake generate_secret_token*
command, however when I do I get this error
rake aborted!
cannot load such file -- mysql2/mysql2
/home/usera/redmine-2.3/config/application.rb:7:in `<top (required)>'
/home/usera/redmine-2.3/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
with --trace
rake aborted!
cannot load such file -- mysql2/mysql2
/usr/local/share/gems/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `require'
/usr/local/share/gems/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/home/usera/redmine-2.3/config/application.rb:7:in `<top (required)>'
/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
/home/usera/redmine-2.3/Rakefile:5:in `<top (required)>'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/usr/local/share/gems/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/bin/rake:23:in `load'
/bin/rake:23:in `<main>'
I am running the command as root. This is the guide I used http://www.redmine.org/projects/redmine/wiki/RedmineInstall
Do you have installed the necessary native libraries for mysql2 adaptor ?
You can check:
mysql2 adapter issues in installing Redmine on Fedora 17