Rails 3. no such file to download - mysql2 / mysql2 in Production

I get this error no such file to load -- mysql2/mysql2 from Passenger in production.

The details of this error are /var/www/releases/20120103021152/vendor/cache/ruby/1.9.1/gems/mysql2-0.2.18/lib/mysql2.rb and it is true that the file does not exist.

Why am I getting this error? How can i fix this?

+4
source share
3 answers

In the end, I manually deleted all the gems inside the gems folder and installed the package. Inconvenient stone (mysql-2.0.18 version or something precious) ceases to be installed.

+3
source

I have the same error.

 rails s {railsroot}/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require': cannot load such file -- mysql2/mysql2 (LoadError) 

The following worked. ('{railsroot} /vendor/bundle/ruby/1.9.1/gems/' will depend on your system.)

 cd {railsroot}/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/mysql2/ext ruby extconf.rb make make install cd {railsroot}/vendor/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/ext/mri ruby extconf.rb make make install 
+7
source

A few things:

Ruby 1.9.1 has many known errors with rails (3+), consider upgrading to 1.9.2.

Did you manually install gem mysql2 and then add it to your Gemfile? If so, manually remove it (all versions) - then run bundle install

+1
source

Source: https://habr.com/ru/post/1389010/


All Articles