1

Is their any one who can help me to install ROR on elementary OS?
I am new on elementary OS. I want to install ruby on rails on my elementary OS. can anyone please tell me how can i install ruby on rails on elementary OS.

Thank You

2
  • Have you tried my answer (and remember to mark it as answer)
    – Suici Doga
    May 19, 2016 at 11:12
  • The answer below is a good one. As a general rule, being based on Ubuntu 16.04, if you need something for elementary 0.4 just google the question and replace elementary for ubuntu and most times you'll get the result you want.
    – pretz
    Jul 31, 2017 at 16:33

3 Answers 3

2

Run the following commands to install Ruby on rails

sudo apt install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash

rbenv install 2.3.0
rbenv global 2.3.0
ruby -v
gem install bundler
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt install -y nodejs
gem install rails -v 4.2.6
rbenv rehash

Source : https://gorails.com/setup/ubuntu/14.04

22
  • Can you please tell me why the following errors occurs? smehsan@smehsan:~$ exec $SHELL bash: /home/smehsan/.bashrc: line 168: syntax error near unexpected token PATH="$HOME/.rbenv/bin:$PATH"' bash: /home/smehsan/.bashrc: line 168: esacexport PATH="$HOME/.rbenv/bin:$PATH"' smehsan@smehsan:~$
    – smehsan
    May 19, 2016 at 11:26
  • @smehsan What error?
    – Suici Doga
    May 19, 2016 at 11:26
  • @smehsan Just restart the terminal instead
    – Suici Doga
    May 19, 2016 at 11:28
  • smehsan@smehsan:~$ exec $SHELL bash: /home/smehsan/.bashrc: line 168: syntax error near unexpected token PATH="$HOME/.rbenv/bin:$PATH"' bash: /home/smehsan/.bashrc: line 168: esacexport PATH="$HOME/.rbenv/bin:$PATH"' smehsan@smehsan:~$
    – smehsan
    May 19, 2016 at 11:28
  • @smehsan Run scratch-text-editor ~/.bashrc and remove the last line and replace it with export PATH=$HOME/.rbenv/plugins/ruby-build/bin:$PATH
    – Suici Doga
    May 19, 2016 at 11:29
0

What Nguyen said worked for me.

Use a text editor and go to the root directory. (I'm using Sublime Text 3)

If you don't have one, you can use the following commands:

cd /
nano .bashrc

Scroll down to the end of the document, then create the line break (Enter in Windows/Linux)

It should look like this:

esac
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"

If you're using the 'nano' command, press Ctrl+O then Enter to save the document.

Press Ctrl+X to exit nano.

Thank you, Nguyen.

-1

enter image description here

For someone who have problem with rbenv and bashrs, this code is worked for me. (We need 'enter' between esac and export)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.