Some doubts about Ruby On Rails installation

Hello to everyone. I’ve setup RubyOnRails on my OpenSuse 13.1 but now I have some doubts about is the way I’ve done it was correct.

  1. Ruby20 is already in the system, so I’ve just added some ruby -devel packages from yast2
  2. then

su
gem install rails

  1. Then I’ve tried to
    rails2.0 server
    for one project created before but faced with need to install sqlite3

  2. So I’ve used yast2 to install sqlite3 and sqlite3-devel

then

gem install sqlite3 -v ‘1.3.9’

  1. Again I’ve tried to
    rails2.0 server
    for one project created before but faced with need to install turbolinks-2.2.1

  2. gem install turbolinks -v ‘2.2.1’

  3. Again I’ve tried to
    rails2.0 server
    for one project created before but faced with need to install uglifier-2.4.0

  4. gem install uglifier

  5. Again I’ve tried to
    rails2.0 server
    for one project created before but faced with the following error:

Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.

  1. Installed nodejs nodejs-devel via yast2.

  2. Finally
    rails2.0 server
    starts correct.

The question is: is this way of installation correct? Or if not, then what could be the possible problems and what is the best way now to fix everything?

I don’t know that there is necessarily one correct way.

Every Project has its own requirements and therefor its own list of dependencies.
As you’ve noticed, when you tried to fire up a project, it kept asking for missing dependencies. That’s normal for projects with limited documentation, you instead hope but don’t always get a list of dependencies in the project’s README. Also, I don’t know exactly how your projects’ files are distributed, but if they are themselves deployed as part of a package management system (eg you’re working with Ruby on Rails, so you should look for a gem) then that would manage the dependencies automatically for you.

Just beware of one thing I found using Ruby on Rails…
I found that you <must> use the very common bundle install from the openSUSE Ruby repo and not the universal version installable as a gem.

You might find something interesting in the following link, it describes installing the openSUSE ruby repo and what I felt was basic for getting started. Change the version (12.3) to 13.1 or anything else if you wish.
http://en.opensuse.org/User:Tsu2/Kibana#Install_Overview_.28This_applies_only_to_kibana_2.x_and_earlier_for_archival_purposes.29

HTH,
TSU

True…missing dependencies gave me huge troubles once…

I always use rvm in installing ruby on rails. It allows you to choose what version of ruby you want to use as well as what version of rails you would like to use as well.

That’s OK but working with the openSUSE repos, it’s also as easy as daxh describes, you only need to install the base Ruby package and all the dependencies installed after that will look for that version.

TSU

I forgot to mention that there is a really great tutorial on setting up ruby on rails done by onemonthrails I would check it out, it will save you time in the long run.