`require': no such file to load -- sqlite3/sqlite3_native (LoadError) - ruby-on-rails

Trying to get ruby on rails 1.8.7 working on windows but when i start rails server i get this error:
`require': no such file to load -- sqlite3/sqlite3_native (LoadError)
I have tried copying the 3 files and putting them in ruby/bin but it doesnt help as mentioned at the bottom of this post: http://www.ruby-forum.com/topic/216270
Any ideas?

Found the solution on this post's comments http://www.shaunambrose.com/2010/08/05/how-to-fix-a-sqlite3-dll-missing-error-message-in-ruby-on-rails/comment-page-1/#comment-15965
"The problem seems to be that the sqlite3 gem is compiled with version 3.7.3. I downloaded and set up version 3.7.3 instead and it now works just fine."
Get it here: http://www.sqlite.org/sqlitedll-3_7_3.zip

Uncomment the line “gem ‘sqlite3-ruby’, :require => ‘sqlite3′” and comment the line “gem ‘sqlite3′” in your Gemfile

While I was trying to play around Amazon Linux, I too faced the same
"/usr/local/share/ruby/gems/2.0/gems/sqlite3-1.3.10/lib/sqlite3.rb:6:in
`require': cannot load such file -- sqlite3/sqlite3_native
(LoadError)"
Since everything was already setup on my local, I tried debugging.
The issue apparently is the library is missing in
/usr/local/share/ruby/gems/2.0/gems/sqlite3-1.3.10/lib/sqlite3/
If you go to this path, you will see that sqlite3_native.so is not present.
What I did was simply, ran a locate sqlite3_native.so and copied it to the location.
I faced the same issue with all other libraries in Amazon Linux, including nokogiri and nodejs.

Related

Errors of nokogiri "Load Error" with docker-compose up

I am running a rails app with docker-compose on a m1 mac.
Kept getting 2 specific errors,
/usr/local/bundle/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
This is the first one
/usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/extension.rb:7:in `require_relative': Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/3.1/nokogiri.so) - /usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/3.1/nokogiri.so (LoadError)
This is the second one.
The errors started showing after all the gems are installed, I have reinstalled nokogiri countless times, rebuilt the image and container, and made sure bundle installs in my dockerfile as well.
This problem was resolved by adding platform: linux/x86_64 into my docker-compose.yml file

how do I make webpack-dev-server respect rbenv configuration?

I've got an existing rails app using webpacker and I just attempted to migrate from rvm to rbenv. Everything appeared to be working in my automated tests, but when I try to fire up bin/webpack-dev-server, it seems to want to use the System ruby rather than the one specified by my Gemfile (and my .ruby-version). It tells me:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require': cannot load such file -- bundler/setup (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from ./webpack-dev-server:12:in '<main>'`
As near as I can tell, this is happening because of the following line at the top of the webpack-dev-server script:
#!/usr/bin/env ruby
but I do not know how to make it work properly with rbenv. When I run rails webpacker:check_binstubs, it does not show me any errors, but clearly there is a problem. Did I miss a step in removing rvm? Please help.

Ruby failing to run after upgrading (sqlite3_native LoadError); sqlite3 not upgrading properly

I have upgraded to ruby 2.5.0 but I am having conflicts everywhere. I have checked previous posts on stack overflow such as:
Ruby on Rails - "Add 'gem sqlite3'' to your Gemfile"
cannot load such file — sqlite3/sqlite3_native
cannot load such file -- sqlite3/sqlite3_native (LoadError) on ruby on rails
https://github.com/sparklemotion/sqlite3-ruby/issues/137
But none of them are working for me. My issue is similar to these posts in that after I run rails server after a long error message the last few lines read:
1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in 'block in require'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 'require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
I have tried creating a new project, reinstalling sqlite3 through gem and minigw itself, reinstalling rails and ruby. I have tried most of the instructions in the previous questions but nothing works. SQLite3 version 3.25.2, Ruby 2.5.3, rails 5.2.1
Sorry, this might be a simple fix but I am a complete beginner to ruby and I have been trying different things for a few hours now. Any help is appreciated.
As explained in this answer https://stackoverflow.com/a/49736971/4685144, you should now be able to install sqlite3 using git:
gem 'sqlite3', git: 'https://github.com/sparklemotion/sqlite3-ruby'
Then bundle install

cannot load such file — sqlite3/sqlite3_native (LoadError) on ruby on rails

2.5.1 Ruby, 5.2.1 Rails versions. Everything is installed from scratch. Im trying to create a project in RubyMine, and this error pops up right from the start, and i can do nothing untill this error is solved.
This solution didnt work for me:
cannot load such file -- sqlite3/sqlite3_native (LoadError) on ruby on rails
Couldnt make to the end of this solution:
An error occurred while installing sqlite3 (1.3.11), and Bundler cannot continue
on 5-th step after execution of "configure" promt says that no acceptable c compiler found in PATH.
Help please.
So it seems that there are some problems with compability on this versions of ruby, rails, and sqlite. I've installed rails installer with 2.3.3 ruby and 5.1.6 rails, and error dissapeared.

Ruby gems: Cannot load such file [duplicate]

This question already has answers here:
new macbook - trying to run Rails, now I get "internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)"
(2 answers)
Closed 8 years ago.
Hi i'm trying to install some gems, but when I do i get the error
ERROR: Gem bundler is not installed, run gem install bundler first.
so when I do the command gem install bundler I get this:
:1:in require': cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in'
It happens every time I try to do something with gems...I'm new at this, so I would appreciate some help...I've search a lot but instead of solving the problem I keep getting deeper
I'm having a similar problem when I try to install some gems, I think it is because rubygems.org is down.
Check this: "Could not find a valid gem in any repository" (rubygame and others)
Check tomorrow if you can install it.

Resources