i am trying to install rails in my eee pc with the last version of ubuntu and i have some package that are told installable.how is it possible?i can even install gem
fenec#fenec-laptop:~$ gem
The program 'gem' can be found in the following packages:
* rubygems1.8
* rubygems1.9.1
Try: sudo apt-get install <selected package>
gem: command not found
root#fenec-laptop:/home/fenec# apt-get install rubygems1.8
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package rubygems1.8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package rubygems1.8 has no installation candidate
Is it possible that some package are not installable due to my hardware? I have this problem only with this version of ubuntu i used to have ubuntu 8.10 and rails was working like a charm.
I usually install ruby gems from source. I would try following this guide - it's worked for me on multiple different Ubuntu installs.
See: https://help.ubuntu.com/community/RubyOnRails
Related
Running on a fresh install of Ubuntu Server 18.04 on Virtualbox, Windows 10 as the host OS. Ran the instructions on the Phusion Passenger site here
This is the error I'm getting:
steve#heartypet-staging:~$ sudo apt-get install -y libnginx-mod-http-passenger
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libnginx-mod-http-passenger : Depends: passenger (= 1:5.3.4-1~bionic1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Oddly enough, the exact same instructions work fine on the desktop version.
Get default source list from here
https://askubuntu.com/a/1036749
Replace /etc/apt/source.list with the file in the link above.
Then sudo apt update and sudo apt upgrade
And go ahead...
If you having problems with the previous solution, one option is run this command:
sudo nano /etc/apt/sources.list.d/passenger.list
and comment all the lines in this file, then run the command
sudo apt-get install passenger
I have mariadb-10.1 installed on a stock 64bit Ubuntu 15:10.
I have libmysqlclient18 succesfully installed, but I get errors when trying to install libmysqlclient-dev.
steve#steve:~$ dpkg -s libmysqlclient18
Package: libmysqlclient18
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 10
Maintainer: MariaDB Developers <maria-developers#lists.launchpad.net>
Architecture: amd64
Source: mariadb-10.1
Version: 10.1.13+maria-1~wily
Replaces: libmysqlclient18 (<< 10.1.13+maria-1~wily)
Depends: libmariadbclient18 (= 10.1.13+maria-1~wily)
Description: Virtual package to satisfy external depends
This is an empty package that provides an updated "best" version of
libmysqlclient18 that does not conflict with the libmariadbclient18
package.
.
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MariaDB are speed, robustness and
ease of use.
Homepage: http://mariadb.org/
steve#steve:~$ sudo apt-get install libmysqlclient-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
libmysqlclient-dev : Depends: libmysqlclient18 (= 5.6.28-0ubuntu0.15.10.1) but 10.1.13+maria-1~wily is to be installed
E: Unable to correct problems, you have held broken packages.
Can anyone suggest how to resolve this?
Thanks :-)
Steve
You have to install libmariadbclient-dev instead of libmysqlclient-dev when using MariaDB
sudo apt-get install libmariadbclient-dev
While installing libmariadbd-dev or libmariadbclient-dev package is the easiest way, in some OS's or package managers it is not available.
For example on a mac with homebrew this is not available, I found a workaround though.
To install gem mysql2 on a mac you need mariadb-connector-c in homebrew. This package conflicts with Mariadb symlinks so you need to do run the following in the terminal:
brew unlink mariadb
brew install mariadb-connector-c
Inside the rails project directory, execute:
bundle install (or gem install mysql2)
brew uninstall mariadb-connector-c
brew link mariadb
I was trying to install rails on Ubuntu Natty Narwhal 11.04, using ruby1.9.1.
I installed ruby using apt-get install ruby1.9.1-full which contains the dev package. I googled the error and all have suggested I install the 1.9.1-dev which I already have.
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:36:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:36
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
After some search for a solution it turns out the -dev package is needed, not just ruby1.8. So if you have ruby1.9.1 doing
sudo apt-get install ruby1.9.1-dev
or to install generic ruby version, use (as per #lamplightdev comment):
sudo apt-get install ruby-dev
should fix it.
Try locate mkmf to see if the file is actually there.
This is the answer that worked for me. Was in the comments above, but deserves its rightful place as answer for ubuntu 12.04 ruby 1.8.7
sudo apt-get install ruby-dev
# if above doesnt work make sure you have build essential
sudo apt-get install build-essential
I also needed build-essential installed:
sudo apt-get install build-essential
The problem is still is recursive on Ubuntu 13/04/13.10/14.04
and
sudo apt-get install ruby1.9.1-dev
worked out for me okay. So If you are using Ubuntu 13.04/13.10/14.04 then using this will really come in handy.
This works even if ruby version is 1.9.3. This is because there is no ruby1.9.3-dev available in the Repository...
Have you tried:
sudo apt-get install ruby1.8-dev
I got the similar error when install bundle
sudo apt-get install ruby-dev
Works great for me and solve the problem
Mint 16 ruby1.9.3
I think is a little late but
sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
worked for me on fedora.
http://nokogiri.org/tutorials/installing_nokogiri.html
You've Ruby 1.8 so you need to upgrade to at least 1.9 to make it working.
If so, then check How to install a specific version of a ruby gem?
If this won't help, then reinstalling ruby-dev again.
You can use RVM(Ruby version manager) which helps in managing all versions of ruby on your machine , which is very helpful for you development (when migrating to unstable release to stable release )
or for Linux (ubuntu) go for
sudo apt-get install ruby1.8-dev
then sudo gem install rails to verify it do rails -v it will show version on rails
after that you can install bundles (required gems for development)
Ruby version: 2.7.1
gem version: 3.1.3
You need to check the extension that could not be installed, and find the reasons.
Read the mkmf.log file showed at the installation error under "To see why this extension failed to compile, please check the mkmf.log which can be found here" , perhaps there is a missing lib ( sometimes iconv ), and you must install it.
You can search the extension with your package manager(apt, yum, pacman...) too.
(Personal case) Arch Linux->nokogiri
gem install rails
Showed me:
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/home/user/.gem/ruby/2.7.0/extensions/x86_64-linux/2.7.0/nokogiri-1.10.9/mkmf.log
Go to: https://aur.archlinux.org/packages/ruby-nokogiri/
Make sure you have all dependencies installed
Make sure you have make installed
git clone the package
cd to package
makepkg the package
Hope to help!
I am new to Ruby and just diving in. The Ruby tutorial says I should get the packaging system from here: http://rubyforge.org/frs/?group_id=126
I am on Ubuntu Linux. The page has a .tar and a .gem option for downloading. Which should I download?
Also, are gems exactly analogous to Java jars? And why do I need the gem packaging system if I can just download gems one by one as they are needed?
Ubuntu now have rubygems as a package
For Ubuntu 12:
sudo apt-get install rubygems
For Ubuntu 14.04:
sudo apt-get install rubygems-integration
On Ubuntu 16.04 and Ubuntu 18.04, both sudo apt-get install rubygems and sudo apt-get install rubygems-integration failed for me. Instead, I had to do this:
sudo apt-get install ruby-dev
If on Ubuntu 14.04 try below
sudo apt-get install rubygems-integration
First, download *.tar file, unpack this file, then go to rubygems directory in your console, and type
ruby setup.rb
That's it :)
If you install the full ruby application set with
sudo apt-get install ruby-full
You will get gems and much more by default. Tested on Ubuntu 16, it could also work on other version.
For me in Ubuntu 20.04 I did 3 things to create a new Ruby and Rails app.
Install Ruby development version
sudo apt install ruby-dev
Install rails from gem
sudo gem install rails
Create new application
rails new blog
I got error while installing rails(sudo apt install rails) only, So I installed devlopment version. I got permission related error while not using Sudo as well while installing gems and rails.
For Ubuntu
First install ruby:
sudo apt install ruby
Note that : sudo snap install ruby will throw this error :
error: This revision of snap "ruby" was published using classic
confinement and
thus may perform arbitrary system changes outside of the security
sandbox that snaps are usually confined to, which may put your system at
risk.
If you understand and want to proceed repeat the command including
--classic.
Finally, download latest tar version of ruby gems here:
https://rubygems.org/pages/download
Unzip and cd to the folder and finally type in terminal:
sudo ruby setup.rb
I'm try to install the SQLite gem on a Fedora 9 Linux box with Ruby 1.8.6, Rails 2.2.2, gem 1.3, and sqlite-3.5.9. Here's the command I'm running and its results:
sudo gem install sqlite3-ruby
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 install sqlite3-ruby
can't find header files for ruby.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
gem_make.out just repeats what was already sent to the console. How can I install this gem?
The SQLite RubyGem isn't actually a RubyGem, it's a "CGem", IOW it's written in C. This means it has to be compiled and linked to the Ruby interpreter when you install it and in order to do that it needs the C header files for the Ruby interpreter.
If you compile Ruby yourself, those header files will be installed automatically, however, in RedHat-ish systems, such header files are usually packaged in a seperate package, called <whatever>-dev. So, in this case you will need to install the ruby-dev package and possibly the libsqlite3-dev (Ubuntu) or sqlite-devel (Fedora) package as well.
However, you might be better off just installing your Operating System's pre-packaged libsqlite3-ruby package, that way all the dependencies are automatically satisfied.
(Note: all package names pulled out of thin air, might be different on your system.)
You probably need the ruby dev package. For Ubuntu you have to install ruby1.8-dev which includes the ruby header files. A quick google says that the yum package is ruby-devel. so run this:
sudo yum install ruby-devel
I faced problem installing sqlite3-ruby gem on my fedora 13 box.
It was fixed after sudo yum install sqlite-devel
When I had that problem:
gem install sqlite3 -v '1.3.9'
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
For me worked, installing the "libsqlite3-dev" with:
apt-get install libsqlite3-dev
sudo apt-get install ruby-dev
Fixed it for me.
On Ubuntu 9 and 10 try:
sudo apt-get install ruby-dev
sudo apt-get install sqlite3-dev
Then run
gem install sqlite3
Run the following for Fedora OS:
yum install rubygem-sqlite3
On alpine, you need to install the sqlite-dev package.
I also faced this same issue, the problem is that your Linux installation requires the development libraries for SQLite3 to be installed in order to build the gem.
Here's how I fixed the issue
Open your terminal and run the following commands
sudo apt-get install sqlite3
sudo apt-get install libsqlite3-dev
And then try installing Sqlite3 gem again using this command
gem install sqlite3
That's all.
I hope this helps
Do you have all the source code required to build sqlite3-ruby? Gem is trying to compile some C code and cannot find the headers. You can probably use a fedora rpm for sqlite3-ruby (I don't use fedora, but I'm sure one exists) if you prefer to forgo compiling. Personally for ruby stuff, I prefer to use gem rather than a distro's packaging system.
I'm not really familiar with Fedora, but in Ubuntu when you are installing packages you have apt-get, and you have to install the build-essentials which includes gcc and other compilation tools for C. I would say that could be your issue, and you make look into how that can be install either using RPM or apt-get on Fedora.
I fixed the problem on my OLPC (Fedora 9) by installing 'gcc' oddly enough. It seems like it should have been one of those dev packages, but no.
Also, regarding the other packages, the suffix is "-devel", not "-dev", so make sure you get those ending right: "ruby-devel", "sqlite-devel"...
Once you get that installed, if you get errors about your gems being too old "< 1.3.1" when you try to run various rails scripts, eg: script/server or script/console, google "upgrade_rubygems" to fix that problem...
HTH...
Run "sudo yum install sqlite-devel" and then "gem install sqlite3". Had the same problem on my Fedora 15.
I had this same exact issue...instead of gem'ing the missing pieces I used synaptic on unbuntu.
The key package for me was libsqlite-ruby1.9.1 ... I documented my experience (for reference) with this error at :
Sqlite3-gem-error-during-bundle-install
I encountered this error while running bundle install after generating a react-rails app on Fedora 29. I was able to identify a suitable development package by running dnf search sqlite3, then installed it dnf install libsqlite3x-devel. This fixed it for me.