RoR install: Run 'bundle install' not working? - ruby-on-rails

While trying to run a first project on Ubuntu 10.10 I got this:
antonio#antonio-desktop:~/Documents/tickets$./script/rails server
Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
Well, afterwards I write:
antonio#antonio-desktop:~/Documents/tickets$ bundle install
and get this in the middle of the installation process:
/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
So, I tried this:
sudo yum install sqlite3-devel
And got this:
Setting up Install Process
No package sqlite3-devel available.
Nothing to do
Why? I'm running Rails 3.1, btw.

try: sudo apt-get install libsqlite3-dev

Since you're using yum, I went ahead and guessed that you're on Fedora. I then Googled "fedora sqlite3" and found a blog post that recommends this:
sudo yum install sqlite-devel
Sounds like the gem doesn't have the package name quite right. Give this one a go :)

Related

Error instaliling sqlite3. Failed to build gem native extension

Everytime I try to install bundle I receive this error and I dont know what to do, I just update rails to 3.2.0. Im already on Ubuntu and my sqlite3 version is 3.37.2
I have tryed to uninstall sqlite3 and gem sqlite3-rails and then reinstall them, but nothing has change.
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
current directory: /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4/ext/sqlite3
/home/computer/.rbenv/versions/3.2.0/bin/ruby -I /home/computer/.rbenv/versions/3.2.0/lib/ruby/3.2.0 extconf.rb
Building sqlite3-ruby using packaged sqlite3.
Extracting sqlite-autoconf-3400000.tar.gz into tmp/x86_64-linux-gnu/ports/sqlite3/3.40.0... OK
Running 'configure' for sqlite3 3.40.0... OK
Running 'compile' for sqlite3 3.40.0... OK
Running 'install' for sqlite3 3.40.0... OK
Activating sqlite3 3.40.0 (from /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4/ports/x86_64-linux-gnu/sqlite3/3.40.0)...
Could not configure the build properly (pkg_config). Please install either the `pkg-config` utility or the `pkg-config` rubygem.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/extensions/x86_64-linux/3.2.0/sqlite3-1.5.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4 for inspection.
Results logged to /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/extensions/x86_64-linux/3.2.0/sqlite3-1.5.4/gem_make.out```
I solved it installing pkg-config and then bundle install worked correctly
sudo apt-get update -y
sudo apt-get install -y pkg-config
bundle isntall

ruby on rails rmagick can't use, cloud9

I am using cloud9.
I want to use gem 'rmagick', but using bundle, following error message occurs...
please help...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/usr/local/rvm/gems/ruby-2.4.0/gems/rmagick-2.16.0/ext/RMagick
/usr/local/rvm/rubies/ruby-2.4.0/bin/ruby -r
./siteconf20180204-XXXXXX-oyXXpq.rb extconf.rb checking for gcc... yes
checking for Magick-config... no checking for pkg-config... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc' to the
PKG_CONFIG_PATH environment variable No package 'MagickCore' found
checking for outdated ImageMagick version (<= 6.4.9)... * extconf.rb
failed * Could not create Makefile due to some reason, probably lack
of necessary libraries and/or headers. Check the mkmf.log file for
more details. You may need configuration options.
I just spun up a Cloud9 VM and tried it.
My Cloud9 VM I tried used yum as a package manager. Meaning I installed ImageMagick via sudo yum install ImageMagick-devel... when I did that my gem install rmagick worked.
Didn't try it with Bundler, but if gem install works then it should work in Bundler also.
Using the command prompt install/update imagemagick via
sudo apt-get update
Then
sudo apt-get install imagemagick
See more
Hope it helps

Cannot install sqlite3 -v '1.3.9' on Mac

I just started to learn Ruby on Rails by following some tutorials. Rails had been working well until one day it just stopped working. The code following is what I got from the Terminal when I tried to run rails:
$ rails -v
Looks like your app's ./bin/rails is a stub that was generated by Bundler.
In Rails 4, your app's bin/ directory contains executables that are versioned
like any other source code, rather than stubs that are generated on demand.
Here's how to upgrade:
bundle config --delete bin # Turn off Bundler's stub generator
rake rails:update:bin # Use the new Rails 4 executables
git add bin # Add bin/ to source control
You may need to remove bin/ from your .gitignore as well.
When you install a gem whose executable you want to use in your app,
generate it and add it to source control:
bundle binstubs some-gem-name
git add bin/new-executable
WARN: Unresolved specs during Gem::Specification.reset:
i18n (>= 0.6.9, ~> 0.6)
json (>= 1.7.7, ~> 1.7)
tzinfo (~> 1.1)
minitest (~> 5.1)
thread_safe (~> 0.1)
rake (>= 0.8.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Could not find sqlite3-1.3.9 in any of the sources
Run `bundle install` to install missing gems.
So I ran bundle install and gem install sqlite3-1.3.9 but neither of them worked. The code following is from the Terminal when I ran gem install sqlite3-1.3.9:
$ sudo gem install sqlite3 -v '1.3.9'
Password:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... no
sqlite3 is missing. Try 'port install sqlite3 +universal',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
But when I tried 'port install sqlite3 +universal', 'yum install sqlite-devel' and 'apt-get install libsqlite3-dev', the terminal showed:
$ apt-get install libsqlite3-dev
-bash: apt-get: command not found
Command is not found even for yum and port. Some people said that I should install ruby-dev package and possibly the libsqlite3-dev (Ubuntu) or sqlite-devel (Fedora) package as well, but I don't know how to do it. What should I do? Should I reinstall Ruby and Rails? Thank you very much!!!

How to install sqlite3 gem on EC2?

When I tried to:
sudo yum install ruby-devel sqlite3-devel
Amazon EC2 returns:
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Package ruby-devel-1.8.7.330-1.5.amzn1.i686 already installed and latest version
No package sqlite3-devel available.
Nothing to do
Any help will be appreciated.
UPDATE:
sudo gem install sqlite3-ruby
returns
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
sudo yum install sqlite3-devel should be:
sudo yum install sqlite-devel
On my Ubuntu box, I installed the following two libraries, plus the gem, in the following order:
sudo apt-get install libsqlite3-dev
sudo apt-get install sqlite3 # this installs several tools, including the command-line utility
sudo gem install sqlite3-ruby # this is going to spit out a bunch of errors, but you may be able to ignore them

Error setting up Ruby on Rails

Following this guide, I'm attempting to set up Ruby on Rails using Amazon's EC2. For my instance I've selected "Basic 32-bit Amazon Linux AMI 2010.11.1 Beta". I have ruby, sqlite, and rubygems installed. I'm on step 3.3 of the linked guide which is to run the following command
bundle install
The result is the following. I'm sure I've just missed something, but I'm at a loss. Any suggestions?
Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems /installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.3 for inspection.
EDIT: Following the suggestion below to install ruby-devel, I now get this error in addition to the original one.
Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions':
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
But when I try to run
yum install sqlite-devel
I'm told:
Package sqlite-devel-3.6.20-1.6.amzn1.i386 already installed and latest version
Nothing to do
In addition to the packages above, mas sure you have gcc and make installed.
They are needed to build the gems you are installing in addition to the development libraries.
Try to install the libsqlite3-dev before
$ sudo apt-get install libsqlite3-dev
and retry to install the gem after
$ gem install sqlite3-ruby
This worked for me:
yum install ruby-devel
yum install sqlite-devel
NOT sqlite3-devel
Venturing a guess here, but you might be missing a few development packages. Try running:
yum install ruby-devel sqlite3-devel

Resources