Ubuntu 10 Ruby 1.9 Rails 3: No Such File or Directory

Ubuntu 10 Ruby 1.9 Rails 3: No such file or directory

log in as root user


remove old ruby

list ruby packeges

dpkg -l | grep ruby

then remove all ruby packeges

aptitude purge <package name>

if you have rvm installed

rvm remove all

then

rvm implode

or

rvmsudo rvm implode

install ruby

still logged in as root

install all of the necessary tools and libraries

apt-get install curl git-core build-essential zlib1g-dev libssl-dev libreadline5-dev

install rvm

bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Then add this line as the last line in your .bashrc:

nano ~/.bash_profile

if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi

test RVM install

rvm notes

Next, you can begin ruby 1.9.2 installation by running

rvm install 1.9.2

The install will take up to several minutes and once it completes you have to set ruby 1.9.2 as the default version

rvm --default ruby-1.9.2

test your new ruby install
ruby -v

install Rails 3

gem install rails

If you want to get a quick database up and running with sqlite, then you’ll need to sqlite3 and the libsqlite3-dev packages

apt-get install sqlite3 libsqlite3-dev

gem install sqlite3-ruby

create new app

rails new testapp

cd testapp

Make sure you are in your test app directory and run

rails s

Open your browser at
http://localhost:3000

Ruby 1.9.2 and Rails 3 cannot open rails console

Apparently ubuntu and ruby don't always catch dependencies like they should.

From the first google hit (yeah, I clicked on this stack-overflow in place #2 before checking out the first result.)

Navigate to the Ruby source and enter:

sudo apt-get install libreadline5-dev
cd ext/readline
ruby extconf.rb
make
sudo make install

So, if you're on another distro, make sure you install readline somehow (source/package), then run make/install on extconf from the source. I tried what gkaykck suggested of course but got this without readline already on my system.

$ ruby extconf.rb
checking for tgetnum() in -lncurses... no
checking for tgetnum() in -ltermcap... no
checking for tgetnum() in -lcurses... no
checking for readline/readline.h... no
checking for editline/readline.h... no

rails 3, why I can't use command line at ubuntu?

I don't believe your rvm has been setup correctly. For sake of simplicity, let's start from the beginning following the instructions here:

http://beginrescueend.com/rvm/install/

Install in command line.

user$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

Open your .bashrc folder in your home directory.

user$ vim .bashrc

Edit and add:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

Source your .bashrc file and close the terminal

user$ source ~/.bashrc
user$ exit

Reopen terminal and check if rvm is working.

user$ type rvm | head -1

If it returns

rvm is a function

We're good. Check if you have all of the prerequisites:

rvm requirements

Install as necessary. Pick your favorite flavor of ruby (it seems like it is 1.8.7, if so follow the exact command or replace it with your choice).

rvm install 1.8.7

When its done,

rvm use 1.8.7 --default

If this didn't work, please update post by running

which ruby

Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

You have broken version of RVM. Ubuntu does something to RVM that produces lots of errors, the only safe way of fixing for now is to:

sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh

open new terminal and validate environment is clean from old RVM settings (should be no output):

env | grep rvm

if there was output, try to open new terminal, if it does not help then restart your computer.

install RVM:

\curl -L https://get.rvm.io | 
bash -s stable --ruby --autolibs=enable --auto-dotfiles

If you find you need some hand-holding, take a look at Installing Ruby on Ubuntu 12.04, which gives a bit more explanation.

Ruby 1.9.3 - cannot load such file for some reason

It happens because of the wrong Sublime Text build system. The right one is here How to run ruby files in sublime-text-2

Ubuntu not detecting Rails installation

As rails gem was installed and all the other paths look correct, you need to set rvm to use that ruby as your default version. It will set all the paths correctly so you can use your gems and rails command.

rvm use 1.9.3 --default

Load error while creating new Rails application

Finaly solved.

ln -s /share/MD0_DATA/.qpkg/Optware/lib/libcrypto.so.0.9.8 /lib/libcrypto.so.0.9.8

did the trick.



Related Topics



Leave a reply



Submit