Heroku Taps load error - sqlite

I'm trying to use Heroku Taps but after "gem install taps", I'm still getting the following error when I do "heroku db:pull":
heroku db:pull
Taps Load Error: dlopen(/Users/yves/.rvm/gems/ruby-1.8.7-p302/gems/sqlite3-1.3.3/lib/sqlite3/sqlite3_native.bundle, 9): no suitable image found. Did find:
/Users/yves/.rvm/gems/ruby-1.8.7-p302/gems/sqlite3-1.3.3/lib/sqlite3/sqlite3_native.bundle: mach-o, but wrong architecture - /Users/yves/.rvm/gems/ruby-1.8.7-p302/gems/sqlite3-1.3.3/lib/sqlite3/sqlite3_native.bundle
You may need to install or update the taps gem to use db commands.
My setup:
Homebrew
RVM
rvm list
rvm rubies
jruby-1.5.1 [ x86_64-java ]
ree-1.8.7-2010.02 [ i386 ]
ruby-1.8.7-p160 [ i386 ]
=> ruby-1.8.7-p302 [ i386 ]
ruby-head [ i386 ]
GEMS
gem list
...
heroku (1.17.10)
...
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
taps (0.3.15)
...

Ok, think I solved it. I installed ruby 1.8.7 again with RVM and that seemed to do the trick. Not sure why though...
rvm install ruby-1.8.7-p302

The error message indicates that the Heroku bundle includes a native version sqlite gem that is not compatible with the i386 architecture.
Try to do a gem update sqlite3 sqlite3-ruby
Updated: On my Mac OS X Snow Leopard machine, I use rvm to manage ruby 1.9.2 and rails 3.0.3, but I use the system installed ruby 1.8.7 for ruby 1.9 and rails 2.3.8. development. I switch between ruby 1.8 and 1.9 by using 'rvm system' and 'rvm default' (I set up 1.9.2 as my default in rvm.
I noticed when I am running 'rvm system', I get the following:
$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
$ rails -v
Rails 2.3.8
$ gem list --local | grep taps
taps (0.3.15, 0.3.12, 0.3.10, 0.2.26, 0.2.25)
$ gem list --local | grep sqlite
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3, 1.3.1, 1.2.5, 1.2.4)
Hope this helps.

Related

Install gem eventmachine 1.2.7 with ssl on m1

I'm posting this in case anyone else has the same issue. I was trying to deploy my ruby project from and apple m1 laptop and was getting libc++abi: terminating with uncaught exception of type std::runtime_error: Encryption not available on this event-machine .
Checking eventmachine gave
ruby -reventmachine -ve "puts EM.library_type, EM.ssl?"
ruby 2.6.7p197 (2021-04-05 revision 67941) [arm64-darwin20]
extension
false
Tried an uninstall and install on eventmachine to no avail.
#Chrissy H answer did not work on my M1 Mac, but the following did (by recompiling native extensions)
PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" \
gem install eventmachine
Note that I' musing openssl v1 and needed a specific version, maybe that is why, anyway my full command was:
PKG_CONFIG_PATH="$(brew --prefix openssl#1.0)/lib/pkgconfig" \
gem install eventmachine -v '1.0.9.1'
Searched for where openssl was installed and then uninstalled and reinstalled with
gem install eventmachine -v '1.2.7' -- --with-cppflags=-I/Users/chris/.rbenv/versions/2.6.7/openssl/include
Then had
ruby -reventmachine -ve "puts EM.library_type, EM.ssl?"
ruby 2.6.7p197 (2021-04-05 revision 67941) [arm64-darwin20]
extension
true

Gemfile not found error when installing sqlite3 with bundler/inline

I want to create a Minitest example that uses ActiveRecord. I am installing required gems with bundler/inline:
# activerecord_bug_test.rb
require "bundler/inline"
gemfile(true) do
source "http://rubygems.org"
gem "activerecord", "6.0.2.2"
gem "sqlite3", "1.4.2"
end
# test code
When I run bundle exec ruby activerecord_bug_test.rb it fails with
/Users/hirurg103/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/installer/parallel_installer.rb:197:in `handle_error': Gem::Ext::BuildError: ERROR: Failed to build gem native extension. (Bundler::InstallError)
current directory: /Users/hirurg103/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.2/ext/sqlite3
/Users/hirurg103/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20200324-11504-1f7q6pd.rb extconf.rb
/Users/hirurg103/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:32:in `build': /Users/hirurg103/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.2/ext/sqlite3/Gemfile not found (Bundler::GemfileNotFound)
...
An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.2' --source 'http://rubygems.org/'` succeeds before bundling.
When I install sqlite3 with
gem install sqlite3 -v '1.4.2' --source 'http://rubygems.org/'
it goes without errors
Do you have any ideas how to fix this? Thank you
Removing bundle exec prefix fixed the error for me:
ruby activerecord_bug_test.rb

Rails 5: Could not load 'active_record/connection_adapters/sqlite3_adapter'

I'm using Ruby 2.3.1 on Windows 7. Based on http://guides.rubyonrails.org/getting_started.html I tried to create a Rails 5 app afresh, but without success due to gem sqlite3-1.3.11.
The first error after "rails start" was "cannot load such file -- sqlite3/sqlite3_native (LoadError)". The problem was solved by Error when starting the Rails server on Windows . That's okay.
But it was impossible for me to fix the second error (LoadError in browser):
"Could not load 'active_record/connection_adapters/sqlite3_adapter'."
Who can help?
This problem may be sqlite is not correclty installed
Firstly check your gem file for line gem 'sqlite3' if not add and run bundle install if problem still persists follow the steps below:
Go to rubyinstaller.org
Download Devkit and setup
Remove Sqlite3 Gem by running gem uninstall sqlite3
Reinstall sqlite3 by running gem install sqlite3
Include gem 'sqlite3' in Gemfile
If still doesn't work your problem is due to version of ruby you are using. Please downgrade your ruby version or Install linux in your machine. I had also used ruby in windows and this actually caused headache and I switched it into linux.

Codeship to run grunt with compass

I'm trying to setup continuous integration with codeship. Our project is a Rails API with an angular app which, for now, is in public directory. In order to work, grunt needs to find compass executable.
I would say that setup commands should be:
rvm use 2.1.3 --install
bundle install
export RAILS_ENV=test
bundle exec rake db:schema:load
bundle exec rake db:migrate
bundle exec rake db:test:prepare
# We need compass in frontend
gem install compass
nvm install 0.10.25
nvm use 0.10.25
npm install
npm install -g grunt-cli
And test pipeline:
bundle exec rspec
cd public && grunt test
However, it seems that codeship doesn't like gem install compass line and it complains with:
Running "concurrent:test" (concurrent) task Warning: /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.4.2 in any of the sources
(Bundler::GemNotFound) from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/spec_set.rb:85:in `map!'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/spec_set.rb:85:in `materialize'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/definition.rb:132:in `specs' from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/definition.rb:177:in `specs_for' from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/runtime.rb:13:in `setup'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler.rb:129:in `setup' from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler.rb:134:in `require'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/compass-1.0.3/bin/compass:26:in `<top (required)>'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/compass:23:in `load'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/compass:23:in `<main>'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
Use --force to continue.
And it gives me a hint I'm not sure to understand:
Please make sure the gem wasn't yanked from http://www.rubygems.org
However, if I remove gem install compass line and, instead, I add compass to my Rails app Gemfile, it works. But I really feel ugly and bad about adding compass to my Gemfile. It has nothing to do with it. My Rails app is a REST API so it doesn't want to know anything about compass, css or anything like that.
Thanks.
I had the same issue today and this is how I solved it:
I edited the Setup Commands on Project Settings > Test.
This way you can run the command gem install compass before run the grunt task(s).
This is how it looks:
Setup Commands screenshot
I hope this works for you too

Sqlite-3 error while running ROR application

When i try to run Ruby on Rails application.... i facing the following error
symbol lookup error: /home/user/.rvm/gems/ruby-1.9.2-preview3/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_initialize
I don't know whats the error exactly. can any one please help me out this......
I had the same issue this morning after upgrading sqlite3-ruby to 1.3.0. A quick fix is to uninstall 1.3.0 and ensure 1.2.5 is installed:
gem uninstall sqlite3-ruby --version 1.3.0
gem install sqlite3-ruby --version 1.2.5
The better option is to set your gem config to ignore 1.3.0. For Rails 2.x, in config/environment.rb:
config.gem 'sqlite3-ruby', :lib => 'sqlite3', :version => '!= 1.3.0'
or if you want it play it really safe, explicitly pull in 1.2.5:
config.gem 'sqlite3-ruby', :lib => 'sqlite3', :version => '1.2.5'
If you lock your gemfile to sqlite3-ruby you will have problems starting your application on recent Rails versions since Rails wants to have the gem named "sqlite3". The real solution to this problem is to ensure that the .bundle file that the gem creates indeed links to the right sqlite3 libraries.
By default, sqlite3 gem will link to a nonexisting library in your /usr/lib. This is NOT right. What you need to do is set the compliation options straight for your system and reinstall the sqlite3 gem, and you can easily do this using
$bundle config
Their manpage specifies what it does, but this is the command that I needed to do (I have a roll-your-own SQLite install from their site, not via brew or macports).
$bundle config build.sqlite3 --with-sqlite3-include=/usr/local/include --with-sqlite3-lib=/usr/local/lib
This will always feed the right options to the gem when you try to "bundle install" it and your gem will build properly.
Note that this problem is kinda sneaky in that it will not occur on Ruby 1.9 - apparently rbconfig there has been updated and does better library lookup. But when you are going for 1.8 compatibility - use this bundle configuration and you will be all set.
I'm had the same issue on my Dreamhost server:
> bundle exec rails c
ruby: symbol lookup error: /home/user/settings/installs/rubygems/gems/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_initialize
I downloaded and installed SQLite3 manually in my home directory, and added LD_LIBRARY_PATH to my .bashrc. This fixed the Rails console issue.
However, I still haven't gotten the app to launch in passenger yet, I'm still working on it.
Ruby Enterprise Edition installs the sqlite3 gem automatically, and 1.3.0 seems to be the problem.
If your Rails app doesn't need sqlite3, try uninstalling the gem and restarting your app.
sudo gem uninstall sqlite3

Resources