Ruby 1.9.3, RVM, readline won't install/compile - ruby

I am running into the following error. I was using RVM with Ruby 1.9.2 and all worked perfect. I updated to ruby version 1.9.3 und now I am getting an load error when I try to use the irb.
/home/pabera/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': cannot load such file -- active_support (LoadError)
Actually I have all the readline packages installed (it worked fine with 1.9.2)
Now I tried several thinks, using rvm pkg readline. Doing this, I get the following output.
$ rvm pkg install readline
Fetching readline-5.2.tar.gz to /home/pabera/.rvm/archives
Extracting readline-5.2.tar.gz to /home/pabera/.rvm/src
Applying patch '/home/pabera/.rvm/patches/readline-5.2/shobj-conf.patch'...
Prepare readline in /home/pabera/.rvm/src/readline-5.2.
Error running 'autoreconf -is --force', please read /home/pabera/.rvm/log/readline/autoreconf.log
Configuring readline in /home/pabera/.rvm/src/readline-5.2.
Compiling readline in /home/pabera/.rvm/src/readline-5.2.
Installing readline to /home/pabera/.rvm/usr
Fetching readline-6.2.tar.gz to /home/pabera/.rvm/archives
Extracting readline-6.2.tar.gz to /home/pabera/.rvm/src
Applying patch '/home/pabera/.rvm/patches/readline-6.2/patch-shobj-conf.diff'...
Prepare readline in /home/pabera/.rvm/src/readline-6.2.
Error running 'autoreconf -is --force', please read /home/pabera/.rvm/log/readline/autoreconf.log
Configuring readline in /home/pabera/.rvm/src/readline-6.2.
Compiling readline in /home/pabera/.rvm/src/readline-6.2.
Installing readline to /home/pabera/.rvm/usr
I get the error in the middle, and I don't know how to fix it
Error running 'autoreconf -is --force', please read /home/pabera/.rvm/log/readline/autoreconf.log
My Autoconf.log output. Might this autoconf problem cause my issues? And yes, how would I fix thos missing templates then?
$ cat /home/pabera/.rvm/log/readline/autoreconf.log
[2012-03-19 10:07:03] autoreconf -is --force
autoheader: warning: missing template: CTYPE_NON_ASCII
autoheader: Use AC_DEFINE([CTYPE_NON_ASCII], [], [Description])
autoheader: warning: missing template: FIONREAD_IN_SYS_IOCTL
autoheader: warning: missing template: HAVE_BSD_SIGNALS
autoheader: warning: missing template: HAVE_GETPW_DECLS
...
autoreconf: /usr/bin/autoheader failed with exit status: 1
Do you have any suggestions?

Looks like you might forgot to use a ruby:
rvm use 1.9.3 --default
The default flag will tell rvm to use it for new terminals.
For using with projects (like rails):
cd projects/my-app
rvm use 1.9.3#my-app --rvmrc --create
Which will create a gemset my-app and project configuration file .rvmrc - now when you cd to that dir RVM wil swithc to that ruby#gemset.
There is very nice screencast showing basics of rvm usage: http://screencasts.org/episodes/how-to-use-rvm

Related

RVM warning when installing Passenger on the Mac

Installing Passenger on the Mac runs into this problem.
Any suggestions?
sudo passenger-install-apache2-module
...
* Checking for Zlib development headers...
Found: yes
Location: /usr/local/include/zlib.h
Your RVM wrapper scripts are too old, or some wrapper scripts are missing. Please update/regenerate them first by running:
rvmsudo rvm get stable && rvm reload && rvmsudo rvm repair all
If that doesn't seem to work, please run:
rvmsudo rvm wrapper [] --no-prefix --all
First I did:
$ rvmsudo rvm get stable && rvm reload && rvmsudo rvm repair all
Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. export rvmsudo_secure_path=1 to avoid the warning.
which re-installed rvm and then I did:
$ rvmsudo rvm wrapper [] --no-prefix --all
Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. Run:
export rvmsudo_secure_path=1
to avoid the warning, put it in shell initialization file to make it persistent.
In case there is no `secure_path` in `/etc/sudoers`. Run:
export rvmsudo_secure_path=0
to avoid the warning, put it in shell initialization file to make it persistent.
awk: nonterminated character class ^[]=
source line number 1
context is
>>> /^[]=/ <<<
sed: 1: "s#^[]=##
": unbalanced brackets ([])
Unknown ruby interpreter string component: '[]'.
Could not load ruby [].
Add to your ~/.profile or ~/.bash_profile
export rvmsudo_secure_path=0
You may try to install passenger without sudo.
$ passenger-install-apache2-module

rvm pkg install ree_dependencies gives error about autoreconf

I am running this command on Linux Mint 14 Mate:
rvm pkg install ree_dependencies --verify-downloads 1
and I get this error:
Fetching ncurses-5.7.tar.gz to /home/john/.rvm/archives
Extracting ncurses to /home/john/.rvm/src/ncurses-5.7
Prepare ncurses in /home/john/.rvm/src/ncurses-5.7.
Error running 'autoreconf -is --force', please read /home/john/.rvm/log/ncurses/autoreconf.log
Configuring ncurses in /home/john/.rvm/src/ncurses-5.7.
Error running './configure --prefix=/home/john/.rvm/usr --with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs', please read /home/john/.rvm/log/ncurses/configure.log
Compiling ncurses in /home/john/.rvm/src/ncurses-5.7.
Error running 'make', please read /home/john/.rvm/log/ncurses/make.log
and here is the log file:
configure:5967: error: possibly undefined macro: AC_DIVERT_HELP
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
I googled for the solution, but got nothing.
Your help is highly appreciated.
instead of ree_dependencies you should read output of rvm requirements - it will show you what needs to be installed.
A word of advice - REE is based on Ruby 1.8 which is no longer maintained, only security fixes will be released for few months, you really should try a newer ruby like 1.9.3, or if it's new project - try ruby 2.0.0 preview2:
rvm install ruby-2.0.0

Ruby 1.9.3 + Rails on Solaris 10 - libyaml is missing

I'm trying to install Ruby on Rails on Solaris 10 box. I managed to build Ruby 1.9.3 from source and I installed gems but when I run gem command every time I get this message:
# gem list
/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
This is really anoying :)
So I tried to rebuild Ruby and here is what I noticed in the output of make.
configuring psych
libyaml is missing. Please install libyaml.
Failed to configure psych. It will not be installed.
I found the extconf.rb script that checks for that and I tried to run it manually:
# pwd
/root/pub/ruby-1.9.3-p194/ext/psych
#
# irb --simple-prompt
>> require 'mkmf'
=> true
>> find_header 'yaml.h'
checking for yaml.h... yes
=> true
>> find_library 'yaml', 'yaml_get_version'
checking for yaml_get_version() in -lyaml... yes
=> true
>> exit
Apparently extconf.rb could find libyaml but make could not. So I'm puzzled why make does not find it. Any thoughts?
There are a couple of walk-throughs online regarding the install of Rails on Solaris.
This is for Rails 3: https://www.machine-unix.com/2011/05/installing-rails3-on-solaris-10-910/
And this one talks about avoiding issues with incompatible libraries: http://www.nowastedmoves.com/2009/geekery/installing-ruby-on-rails-on-solaris-10-1008-2/
I've never tried this on Solaris, but hopefully this will be of help.
I had this problem with Mac OS, perhaps it helps: http://icodeapps.net/?p=8
You need to install libyaml.
If you're install libyaml from a pre-built package, you will likely need a separate package with development headers, usually "libyaml-dev" or similar.
Alternatively you can install libyaml from source:
Download the source package:
http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz. To build and install LibYAML, run:
$ ./configure
$ make
# make install
(Note the last line begins with a #, indicated a root shell, prepend sudo when running as a normal user.)
Then reconfigure and recompile Ruby after installing libyaml.

sqlite3_open_v2 error

after turnning on the server (rails s), getting error message when browsing to the remote link.
then:
/usr/bin/ruby: symbol lookup error: /usr/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.4/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_open_v2
tryed to install sqlite3 gem / downgrade and nothing solves it.
what am i doing wrong?
I got this error this week, and resolved it by adding the path to the sqlite library to LD_LIBRARY_PATH:
This was the path
[/usr/local/lib]$ ls
... libsqlite3.a libsqlite3.la libsqlite3.so libsqlite3.so.0 libsqlite3.so.0.8.6
And I added it in the profile:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
This resolved the issue for me.
I had this problem too.
I resolved it this way :
mv /usr/lib/libsqlite3.so.0 /usr/lib/libsqlite3.so.0.back
gem install sqlite3 -- --with-sqlite3-include=/usr/local/include --with-sqlite3-lib=/usr/local/lib
FWIW, I had to first install sqlite3 because my existing version was too old, and then build sqlite3 gem while pointing to the correct libraries:
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar -zxvf sqlite-autoconf-3070701.tar.gz
cd sqlite-autoconf-3070701
./configure
make && make install
gem install sqlite3 -- --with-sqlite3-include=/usr/local/include --with-sqlite3-lib=/usr/local/lib

Trying to run mongo3 gem on Ubuntu 10.10. Help!

I'm trying to run the ruby gem "mongo3" (http://mongo3.com/)
I'm new to gem, but I would think that running "gem mongo3" should execute it, but I get this error:
chris#Zombie:~$ gem mongo3
ERROR: While executing gem ... (RuntimeError)
Unknown command mongo3
So I did "gem which mongo3" and it said it is located at "/var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb". I then ran "ruby /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb" with the following result:
chris#Zombie:~$ ruby /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb
/var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3/node.rb:1:in `require': no such file to load -- json (LoadError)
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3/node.rb:1
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `require'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `require_all_libs_relative_to'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `each'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `require_all_libs_relative_to'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:53
I'm not sure what I'm doing wrong - I suspect that ruby and gems are confused about where the gems should be loaded from or something. Thanks!
You don't need to do a gem mongo3 or ruby /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb. Instead, just simply run mongo3.
Make sure to follow the usage instructions here to configure it or you'll get runtime errors.
Edit: If you don't install the gem using sudo, then you won't have proper write access to /usr/bin, meaning the mongo3 executable will not be in your path. You'll probably see a warning like this when installing:
WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /home/chris/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
You have two options: install the gem using sudo gem install mongo3 so it properly links to /usr/bin, or add /home/chris/.gem/ruby/1.8/bin to your path.

Resources