When running bundle in my Rails application I get the following error output in the command line:
Using jquery-rails 4.0.5 Using jquery-ui-rails 5.0.5 Using mail_form 1.5.1 Installing mysql 2.9.1 with native extensions Errno::EACCES: Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.2.0/gems/mysql-2.9.1/COPYING An error occurred while installing mysql (2.9.1), and Bundler cannot continue. Make sure that `gem install mysql -v '2.9.1'` succeeds before bundling. I'm using: rails -v: 2.2.4
In my gemfile I have the following for mysql:
group :development do # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' gem 'mysql', '~> 2.9', '>= 2.9.1' # Use Capistrano for deployment gem 'capistrano', '~> 3.4', require: false gem 'capistrano-bundler', require: false gem 'capistrano-rails', require: false gem 'capistrano-rbenv', github: 'capistrano/rbenv', require: false # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end Check the Ruby version($ruby -v) if you get something like this happening, found that mine was locked to and older version of 2.0.0. To fix this run:
$ env | grep PATH $ export PATH="$HOME/.rbenv/bin:$PATH" $ eval "$(rbenv init -)"