0

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 -)" 
6
  • have you tried brew install mysql? Commented Jan 8, 2016 at 20:41
  • I get a warning when I try to run that: Warning: mysql-5.7.10 already installed, it's just not linked @ruby_newbie Commented Jan 8, 2016 at 21:21
  • Can you update to the latest bundler and try again? Commented Jan 9, 2016 at 9:07
  • Yeah, I tried that too, I had read in another blog that that worked for some people. Not so much for me. Commented Jan 9, 2016 at 16:03
  • try brew uninstall pg, brew install pg, brew update pg, then try bundling. Commented Jan 14, 2016 at 17:30

1 Answer 1

1

So, this ended up being very simple. After uninstalling and reinstalling several gems. I figured out that the ruby version was locked to 2.0.0 for some reason. I've added the fix above.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.