What Gives? If Rails is so good why is it so hard to install it?

I have spent hours trying to get some version of Rails installed and all
to
no avail. It seems there are many people who get the same errors but
nobody
seems to have any answers.

I am new to both Rails and Ubuntu. This is where I am trying to set it
up.

Most recently I went to rubyonrails.org and it suggests to use Rails 4.0
and Ruby 2.1 and to use rbenv to install rather than RVM.

It says it installed it but then it doesn’t work.

When I type: ruby -v

I get…

rbenv: ruby: command not found

The `ruby’ command exists in these Ruby versions:
2.1.0

What is this telling me? It says it isn’t found and that it does exist.
Huh?

Why is this so difficult? Any insights to help me get my head around
all
of this would be most welcomed.

Dan

On Wednesday, December 25, 2013 10:43:20 PM UTC, Dan B. wrote:

What is this telling me? It says it isn’t found and that it does exist. Huh?

Have you set 2.1.0 as the ruby version you want to use (see the
“Choosing the ruby version” section of the readme (or run rbenv global
version-to-use)

Why is this so difficult? Any insights to help me get my head around all of this
would be most welcomed.

It’s difficult for non newcomers to remember what obvious things were
non obvious, equally it is hard as a newcomer to know what information
is relevant or not.

Fred

On Wed, Dec 25, 2013 at 4:43 PM, Dan B. [email protected]
wrote:

I have spent hours trying to get some version of Rails installed and all to
no avail. It seems there are many people who get the same errors but nobody
seems to have any answers.

I am new to both Rails and Ubuntu. This is where I am trying to set it up.

Most recently I went to rubyonrails.org and it suggests to use Rails 4.0 and
Ruby 2.1 and to use rbenv to install rather than RVM.

rbenv global 2.1.0

Im on Macs and I found it pretty easy to set up. I remember in the
beginning some version hell with the various Gems but that seems to have
settled down for me.

Maybe I can install a Ubuntu on Parallels on the Mac and see if we can
guide you through this (assuming I can get it to work on Ubuntu).

What version of Ubuntu are you working with?

On Wednesday, December 25, 2013 5:43:20 PM UTC-5, Dan B. wrote:

One of the reasons this becomes difficult, particularly when responding on
a board like this, is that things change quickly. You are talking about
multiple operating systems, multiple versions of ruby, multiple versions
of
rails, multiple tools for managing them. I still see questions on Rails
2
and, quite frankly, that was so long ago I don’t remember. On top of
that,
you will be faced with choices such as rbenv vs. RVM, ERB templates vs.
HAML, etc. and everyone has their arguments as to which is better.

My advice to someone starting out is not to use the standard rails docs.
The edge guides are very well written but, to me, they are more of a
reference. I would start with a good tutorial. Be default, the
tutorial
will make these choices for you, but will give you detailed instructions
on
installing and using them. For example, www.railstutorial.org is one
that
is commonly recommended (and I recommend it as well). That particular
tutorial uses RVM, ERB, and Rspec. Once you have a basic understanding,
you can then explore the other options and determine which are best for
you.

More: followed Install Ruby On Rails on Ubuntu 13.10 Saucy Salamander | GoRails (using the choice
of rvm)

Worked like charm. As they say, do that!

Note: Dont install apt-get ruby or apt-get rails as they will get you
older versions. The rails version is 2.3 which is REALLY old. Follow
the guide.

Then make an app. Do: rails new test1

It will create an app and then run bundle install. This came back with
an error telling me I had to install a certain gem. Do what it says and
install it (it gives the command line) and then bundle install again.
Had to do this about 3 times.

Finally when you get a clean bundle, run: rails s to start a server.
Point the browser to http://0.0.0.0:3000 and see its working

And as you can see from my previous posts timestamp, this only took
about 40 minutes to go from nothing to (i) completely new install of
Ubuntu to (ii) ruby/rails installed with (iii) a basic app

Let me re-phrase that, Parallels is downloading 13.04 desktop so lets
work with that version, shall we?

I use a script called RailsReady, which sets up a fresh
OSX/Ubuntu/CentOS installation with Homebrew, RVM, Ruby, all supporting
libraries, Bundler, Passenger, Rails, Git.

https://github.com/joshfng/railsready

I’ve used it > 100 times, and it has never given me a problem.


Dheeraj K.

I have put together a blog post on exactly the same
topic: http://bit.ly/1hbbBqj

hope it helps.