Containerized Rails application cannot find some libraries - ruby-on-rails

I have a Rails app recently upgraded to 6.1 in an alpine 14 container with ruby 3.0.1 with all required gems compiled and installed, but it won't start:
LoadError: Error loading shared library libmariadb.so.3: No such file or directory (needed by /usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/mysql2.so) - /usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/mysql2.so
The full error text:
site | LoadError: Error loading shared library libmariadb.so.3: No such file or directory (needed by /usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/mysql2.so) - /usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/mysql2.so
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
site | /usr/local/bundle/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `block in require'
site | /usr/local/bundle/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:299:in `load_dependency'
site | /usr/local/bundle/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `require'
site | /usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2.rb:36:in `<main>'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
site | /usr/local/bundle/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
site | /app/config/application.rb:5:in `<top (required)>'
site | /app/Rakefile:4:in `require_relative'
site | /app/Rakefile:4:in `<top (required)>'
site | /usr/local/bin/bundle:23:in `load'
site | /usr/local/bin/bundle:23:in `<main>'
site | (See full trace by running task with --trace)
site | rake aborted!
I don't know exactly what it's trying to load and from where.
I have libmariadb.so.3 (from mariadb-connector-c) installed into /usr/lib and also linked to /usr/local/lib.
/usr/local/bundle/gems/mysql2-0.5.3/lib/mysql2/mysql2.so is also there.
I am not deleting any packages or gems before starting up and there were no errors during bundle installation.
What am I doing wrong?

I think I was able to get around this by
apk add mariadb-dev
Hopefully that helps someone else!

Related

Error when trying to install devise in Ruby on Rails 7.0.0

I'm trying to install devise in the rails version I get the error of the latest version of devise
I have tried with other devise versions but it is update it to the latest,
this is the error:
/usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:321:in `ref': undefined method `reference' for ActiveSupport::Dependencies:Module (NoMethodError)
web_1 | from /usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:340:in `mailer='
web_1 | from /usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:342:in `<module:Devise>'
web_1 | from /usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:11:in `<main>'
web_1 | from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
web_1 | from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
web_1 | from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
web_1 | from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
web_1 | from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
web_1 | from /usr/local/bundle/gems/zeitwerk-2.5.0.beta3/lib/zeitwerk/kernel.rb:35:in `require'
web_1 | from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:66:in `block (2 levels) in require'
web_1 | from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:61:in `each'
web_1 | from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
web_1 | from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:50:in `each'
web_1 | from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:50:in `require'
web_1 | from /usr/local/lib/ruby/3.0.0/bundler.rb:174:in `require'
if you could help me I'd be grateful
Source of the Error
The version of Devise you're using calls a method named reference.
https://github.com/heartcombo/devise/blob/c82e4cf47b02002b2fd7ca31d441cf1043fc634c/lib/devise.rb#L320-L323
def self.ref(arg)
ActiveSupport::Dependencies.reference(arg)
Getter.new(arg)
end
The method existed in Rails 6:
https://github.com/rails/rails/blob/6-0-stable/activesupport/lib/active_support/dependencies.rb#L651-L653
It has been removed in Rails 7:
https://github.com/rails/rails/blob/main/activesupport/lib/active_support/dependencies.rb
This line from Rails 7.0.0.alpha1 changelog explains.
Private internal classes of ActiveSupport::Dependencies have been deleted, like ActiveSupport::Dependencies::Reference, ActiveSupport::Dependencies::Blamable, and others.
https://github.com/rails/rails/blob/main/activesupport/CHANGELOG.md#rails-700alpha1-september-15-2021
Fix: Upgrade Devise
Device has released a 4.8.1 version that's compatible with Rails 7. Run bundle update devise to upgrade.
This fix fixed my bug:
gem "devise", github: "strobilomyces/devise", branch: "patch-1"
https://github.com/heartcombo/devise/pull/5397
Devise already merged the fix for this issue with rails 7 to their main branch.
Until a new version is released, you can point the devise gem to use the main branch from GitHub in your Gemfile:
gem 'devise', git: 'https://github.com/heartcombo/devise', branch: 'main'

Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

I have other rails app on this server working fine...
I have nodejs install on my serveur
I have gem 'therubyracer', platforms: :ruby in gemfile,
I try bundle install,
I try config.assets.js_compressor = Uglifier.new(harmony: true) in prod conf
but nothing resolve the bug...
[passenger_native_support.so] trying to compile for the current user (www-data) and Ruby interpreter...
(set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
Warning: compilation didn't succeed. To learn why, read this file:
/var/www/ddemarque/passenger_native_support-hxohsj.log
[passenger_native_support.so] finding downloads for the current Ruby interpreter...
(set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
Could not download https://github.com/phusion/passenger/releases/download/release-6.0.8/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: no download tool found (curl or wget required)
Trying next mirror...
Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/6.0.8/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: no download tool found (curl or wget required)
Trying next mirror...
Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/6.0.8/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: no download tool found (curl or wget required)
[passenger_native_support.so] will not be used (can't compile or download)
--> Passenger will still operate normally.
Error: The application encountered the following error: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/execjs-2.8.1/lib/execjs/runtimes.rb:58:in `autodetect'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/execjs-2.8.1/lib/execjs.rb:5:in `<module:ExecJS>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/execjs-2.8.1/lib/execjs.rb:4:in `<top (required)>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in `<top (required)>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:66:in `block (2 levels) in require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:61:in `each'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:61:in `block in require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:50:in `each'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler/runtime.rb:50:in `require'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.2.15/lib/bundler.rb:173:in `require'
/var/www/ddemarque/config/application.rb:7:in `<top (required)>'
/var/www/ddemarque/config/environment.rb:2:in `require_relative'
/var/www/ddemarque/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require_relative'
config.ru:3:in `block in <main>'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
/home/USER/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:390:in `run_block_and_record_step_progress'
/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
I force gem execjs to down to 2.7.0 since 2.8.1, it's works...

uninitialized constant V8::JSError on starting ruby server on ubuntu 14.04

I'm a complete noob in ruby, so please pardon my mistakes.
I'm installing Apphera (a social networking crawler) on Ubuntu 14.04, and I'm getting this error when I'm trying to start the ruby server
ankit#APPSERVER:/home/deployer/apphera$ rails s
/usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:61:in `rescue in lock': uninitialized constant V8::JSError (NameError)
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:60:in `lock'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:19:in `initialize'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `instance'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/loader.rb:10:in `initialize'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `<module:Less>'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:9:in `<top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `block in require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:61:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:61:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler.rb:134:in `require'
from /home/deployer/apphera/config/application.rb:16:in `<top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:53:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:50:in `tap'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I understand that this issue that got something to do with the JS environment on the system and I tried installing nodes, but the error was same. I tried almost every solution mentioned on SO, but nothing worked for me.
Here are some specific details about my installation:
Ruby : 1.9.1
gem - v : 2.4.5
gem list | grep libv8 --> libv8 3.16.14.7
gem list | grep therubyracer --> therubyracer 0.12.1
I tried installing therubyracer/libv8 both manually and with with bundle install, but it didn't work. I even made changes to my gemfile/Gemfile.lock, but,again, nothing worked.

Some thing about JS error in starting a Ruby Server on Win7

UPDATE +2 hrs:
I rebooted, uninstalled, and then installed a new copy of the downloaded Railsinstaller program.
Pulled the gem marble down, and installed it. Said it installed correctly. (However, I think I read at some places that just gem name is sufficient and gem install name is redundant.)
Started the server - same problem. Runtime JS doesn't exist.
So I created a new app. Build went through clean. Installed the execjs again. (Installed correctly). The ran 'rails s' and the same exact problem persists.
Solution not found.
I'm an absolute newbie. Sequence of steps:
Installed Ruby the traditional way. Download from Ruby website, install, try to make it work. Something went wrong - the BUNDLE INSTALL said it couldn't find a gem file.
I said no problem - let's search for answers...
I installed Railsinstaller as the full package. Installation went well. I even created a new dummy app called 'my_app'.
Yay...
Then I navigated to the directory with the app and punched 'rails s' on the command prompt (Which by the way is being run as administrator)
The server started (WEBrick).
I go to localhost:3000 and nothing shows.
I go to prompt and do gem install rails
It goes and fetches some gems and does some more work
Now when I start the server - it throws some error about Javascript.
Here's the error:
C:\Sites\my_app>rails s
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs/run
times.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://gi
thub.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUn
available)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/l
ib/execjs.rb:5:in `<module:ExecJS>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/l
ib/execjs.rb:4:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee_script.rb:1:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee-script.rb:1:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-rails-3
.2.2/lib/coffee-rails.rb:1:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-rails-3
.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:68:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:66:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:66:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:55:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:55:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler.rb:122:in `require'
from C:/Sites/my_app/config/application.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:53:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:53:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:50:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
C:\Sites\my_app>
I have no idea what to do next. Please help...
My Hosts file was filled with some validator crap. Cleaned that out and the server is working now.

RubyMine 3.0 setup on Windows 7

All,
I downloaded/installed 1.9.2 windows installer, and then RubyMine3.0RC, and installed it.
Opening a new Rails project, with mysql selected as the DB, gives the following error when I "RUN" it.
D:\ProgramFiles\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Rob/RubymineProjects/test1/script/rails server -p 3000 -b 127.0.0.1 -e development
D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found. - D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `require'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `<top (required)>'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `block in require'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
from C:/Users/Rob/RubymineProjects/test1/config/application.rb:7:in `<top (required)>'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:28:in `block in <top (required)>'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
from C:/Users/Rob/RubymineProjects/test1/script/rails:6:in `require'
from C:/Users/Rob/RubymineProjects/test1/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
Is this supposed to happen? I have installed the mysql2 gem as well, but still seeing these messages in the console.
Thanks for any help!
Make sure you have libmysql.dll from the 5.1.x 32-bit MySQL distribution in PATH or in RUBY_HOME\bin directory.
If it doesn't help, you may have better luck reporting the issue at the mysql2 gem project homepage.
Thanks, I was able to fix the error by copying "libmySQL.dll" file from 'C:\Program Files\MySQL\MySQL Server 5.1\bin' to 'C:\Ruby192\bin'.
For details, refer to post - http://rorguide.blogspot.com/2011/03/getting-error-specified-module-could.html

Resources