I get this error
Gem files will remain installed in
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17 for inspection.
Results logged to
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out
An error occured while installing mysql2 (0.2.17), and Bundler cannot
continue. Make sure that gem install mysql2 -v '0.2.17' succeeds
before bundling.
With a Ruby on Rails application and I can not solve it.
Most folks find this works:
sudo apt-get install libmysql-ruby libmysqlclient-dev
It's probably a compilation error. Maybe you don't have mysql development libs installed in your system.
I need to see the logs to make sure.
Try it and paste the output here:
cat /home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out
Btw: wich operation system are you using?
Related
I tried all methods of here.
But still, the same error occurs.
An error occurred while installing mysql2 (0.5.2), and Bundler cannot
continue.
Make sure that gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'
succeeds before bundling.
My spec is:
MacOS Mojave 10.14.1
Ruby 2.5.3p105
Mysql 8.0.12 with Homebrew
Gemfile:
gem "rails"
gem "mysql2", "0.5.2"
Could you kindly tell me a solution?
This is a very good post. I was facing the same issue using mac. What I ended up doing was the following.
I changed the permission for the Gemfile. I used chmod 755 Gemfile.
I used sudo bundle install. This allowed me to install all the gems in the Gemfile.
I did a rake db:create and rails server.
Got things working. Hope it fixes your issue too.
I had the same issue, when setting up a new machine.
Just running
brew install mysql
fixed the failing mysql gem installation for me.
Don't know if this will help, but I had imilar problems on Mac with MySQL twice. First time I just did a complete reinstall, I made sure there were no MySQL files left in the system. I think I followed this guide. The second time I read that it's an issue with symoblic links which I managed to fix with brew prune (I see that it might have been renamed to brew cleanup now - worth to check both).
So I would like to deploy my rails app on heroku right? Wanna switch from sql3 to postgresql. Should be simple but I keep getting an error when trying to bundle with gem 'pg' in my gemfile. I used homebrew to install postgresql with all its native extensions before trying to bundle. Any ideas? I am on Mac OSX high sierra.
An error occurred while installing pg (1.1.3), and Bundler cannot
continue.
Make sure that gem install pg -v '1.1.3' --source 'https://rubygems.org/'
succeeds before bundling.
That's all I get for the error. Not helpful. I went ahead and uninstalled postrgresql that I installed locally to my machine from their website as well as with homebew. Gonna start from scratch. I haven't done this in years so any help would be appreciated!
I've run into this before where you attempt to install the PG gem, but postgres is not yet installed. Even if you install postgres after that, you'll still run into troubles (this has to do with required libraries not being available or not found). I would recommend uninstalling both, then installing Postgres first, then the PG gem. This is a common gotcha, unfortunately: Installing PG gem on OS X - failure to build native extension Also, I would recommend https://postgresapp.com/ if you continue to have trouble installing PG or having the gem not see your install properly.
After tons of research and trying everything, found an older question on stackoverflow from 2014. If you install postgresql with homebrew like I did, running the command ARCHFLAGS="-arch x86_64" gem install pg will install the gem if bundling or gem install pg don't work. Hope that helps other people who might be stuck like I was
I'm facing gem ruby-opencv installation issue
Gem files will remain installed in /home/k2/.rvm/gems/ruby-2.1.2#rails4/gems/ruby-opencv-0.0.14 for inspection.Results logged to /home/k2/.rvm/gems/ruby-2.1.2#rails4/extensions/x86_64-linux/2.1.0/ruby-opencv-0.0.14/gem_make.out
An error occurred while installing ruby-opencv (0.0.14), and Bundler cannot continue.
Make sure that `gem install ruby-opencv -v '0.0.14'` succeeds before bundling.
I tried below one also
gem install ruby-opencv -v '0.0.14'
ruby -v => 2.1.2
You need to download the opencv package from
https://github.com/Itseez/opencv/tree/master using,
git clone https://github.com/Itseez/opencv.git
or clicking on download button in that same page.
And install the above package using http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html
And then start to install the gem as below
gem install ruby-opencv -- --with-opencv-dir=/usr/local.
Now it will work.
Typically the Ruby opencv gem needs to compile native extensions, including the opencv tools, the sqlite database, the python language, openssl networking, and possibly access to your system's compiler such as gcc.
These extensions are generally easiest to diagnose by using sudo.
Try this if you can:
sudo gem install ruby-opencv -v '0.0.14'
Also, you may want to try changing from using rvm to using ruby-build.
Can you please edit your question, and add the results of the log file?
cat /home/k2/.rvm/gems/ruby-2.1.2#rails4/extensions/x86_64-linux/2.1.0/ruby-opencv-0.0.14/gem_make.out
Have you already installed OpenCV successfully on its own?
You can install OpenCV with these instructions: http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html
If you can install OpenCV, that may help verify you have most of the pieces you need for the Ruby gem.
I got this error
Could not find mysql2-0.3.13 in any of the sources
Run `bundle install` to install missing gems.
I tried to gem install mysql2 but without luck, it didn't fix it. I'm using wampp server and copied the libmysql.ddl to the bin folder of ruby. I also tried adding the path to the gem install just like this.
gem install mysql2 --platform=ruby -- ‘-with-mysql-lib=”C:\wamp\bin\mysql\mysql5.5.24\lib” -with-mysql-include=”C:\wamp\bin\mysql\mysql5.5.24\include”‘
Any ideas on how to fix this? THanks!
First, make sure you have mysql installed on your machine.
If you have an Ubuntu distribution, try:
sudo apt-get install libmysql-ruby libmysqlclient-dev
then try to install the gem again.
I installed mysql2 from sources like this
# i experienced some troubles with mysql2 0.3.13 installing
gem fetch mysql2 -v 0.3.12
gem install mysql2-0.3.12.gem -- ' --with-mysql-include="c:\Program Files (x86)\MariaDB 5.5\include\mysql" --with-mysql-lib="c:\Program Files (x86)\MariaDB 5.5\lib" '
But after each Gemfile updating and bundle install, bundler is installing precompiled version of mysql2 gem and it's very annoying. After manual removing precompiled gem rails app started successfully
P.S. You also need installed Ruby DevKit.
Note: this is my first attempt with Ruby and Rails!
Once I've installed everything I tried to create a new app with
rails new rubyapp
the command created everything and then the bundler started. While running it stopped at
Errno::EACCES: Permission denied - /Library/Ruby/Gems/1.8/build_info/coffee-script-source-1.6.2.info
An error occurred while installing coffee-script-source (1.6.2), and Bundler cannot continue.
Make sure that `gem install coffee-script-source -v '1.6.2'` succeeds before bundling.
well.. no problem.. let's install this..
sudo gem install -p http://myproxy:8080 coffee-script-source -v '1.6.2'
Installing ri documentation for coffee-script-source-1.6.2
1 gem installed
Good. Try again.
bundle install
and stopped here:
Errno::EACCES: Permission denied - /Library/Ruby/Gems/1.8/build_info/execjs-1.4.0.info
An error occurred while installing execjs (1.4.0), and Bundler cannot continue.
Make sure that `gem install execjs -v '1.4.0'` succeeds before bundling.
!!!
Needless to say that I've installed this, tried again and the same error came up with different "gems".
My question is: is there a command to find if I've everything I need installed without doing these steps tons of times (also because they're pretty slow..)?
I've also tried bundling with sudo but maybe it's not working for the proxy.. : /
Thanks in advance
Just to help anyone still looking (I presume you fixed it in the end) running the command sudo chown myuser:myuser /Library/Ruby/Gems/1.8/build_info/ (where /Library/Ruby/Gems/1.8/build_info/ is the directory referenced in the error) fixed this.
I encourage you to install RVM (or rbenv) to install/uninstall ruby interpreters. Ruby interpreter bundled with Mac OS X is too old. Also gem installation procedure for system ruby interpreter requires superuser privileges.
If it is your first attempt to Rails world, please, start it with right tools, and actual ruby version (1.9.3).
Here you can find how to install RVM: https://rvm.io/rvm/install/
Good luck!