I am attempting to install Ruby on Rails on my Debian system to obtain a non-bias review of Ruby of Rails and make a proper comparison of it to Django. Compared to installing Python and the latest version of Django on Debian, installing Ruby and Rails on Debian is the complete opposite experience. I followed the standard Rails installation guide, then also looked at the other guide which go through creating a simple blog. Both seem to lead me on an endless path of frustration. It seems Ruby on Rails on much easier to install for Windows and OS X users, but tedious at best for Linux users, or at least Debian ones. I ended up finding a guide online after some hunting, which explains a rather cumbersome hack to get Ruby on Rails all up and running on your Debian system. I call this process a hack, as Ruby and Rails should just work out of the box, like Python and it's many packages. I am trying to open minded about Ruby on Rails, believe me, I am trying...
Here is how I attempted to install Ruby on Rails(similar to how I would have installed Python/Django):
root@sys1:~# apt-get install ruby
Reading package lists... Done
Building dependency tree
Reading state information... Done
ruby is already the newest version.
ruby set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I already has ruby installed from another package I have(not rails).
root@sys1:~# gem
-su: gem: command not found
root@sys1:~# apt-get install rubygems
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
ruby1.8-dev rubygems1.8
Suggested packages:
rubygems-doc
The following NEW packages will be installed:
ruby1.8-dev rubygems rubygems1.8
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1154 kB of archives.
After this operation, 3322 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://ftp.debian.org/debian/ squeeze/main ruby1.8-dev amd64 1.8.7.302-2squeeze1 [886 kB]
Get:2 http://ftp.debian.org/debian/ squeeze/main rubygems1.8 all 1.3.7-3 [202 kB]
Get:3 http://ftp.debian.org/debian/ squeeze/main rubygems all 1.3.7-3 [66.7 kB]
Fetched 1154 kB in 3s (376 kB/s)
Selecting previously deselected package ruby1.8-dev.
(Reading database ... 94637 files and directories currently installed.)
Unpacking ruby1.8-dev (from .../ruby1.8-dev_1.8.7.302-2squeeze1_amd64.deb) ...
Selecting previously deselected package rubygems1.8.
Unpacking rubygems1.8 (from .../rubygems1.8_1.3.7-3_all.deb) ...
Selecting previously deselected package rubygems.
Unpacking rubygems (from .../rubygems_1.3.7-3_all.deb) ...
Processing triggers for man-db ...
Setting up ruby1.8-dev (1.8.7.302-2squeeze1) ...
Setting up rubygems1.8 (1.3.7-3) ...
Setting up rubygems (1.3.7-3) ...
Didn't have the GEM command, so I needed to install rubygems, as per the Rails installation guide.
root@sys1:~# gem install rails
Building native extensions. This could take a while...
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed i18n-0.6.0
Successfully installed multi_json-1.2.0
Successfully installed activesupport-3.2.3
Successfully installed builder-3.0.0
Successfully installed activemodel-3.2.3
Successfully installed rack-1.4.1
Successfully installed rack-cache-1.2
Successfully installed rack-test-0.6.1
Successfully installed journey-1.0.3
Successfully installed hike-1.2.1
Successfully installed tilt-1.3.3
Successfully installed sprockets-2.1.2
Successfully installed erubis-2.7.0
Successfully installed actionpack-3.2.3
Successfully installed arel-3.0.2
Successfully installed tzinfo-0.3.32
Successfully installed activerecord-3.2.3
Successfully installed activeresource-3.2.3
Successfully installed mime-types-1.18
Successfully installed polyglot-0.3.3
Successfully installed treetop-1.4.10
Successfully installed mail-2.4.4
Successfully installed actionmailer-3.2.3
Successfully installed rake-0.9.2.2
Successfully installed thor-0.14.6
Successfully installed rack-ssl-1.3.2
Successfully installed json-1.6.6
Successfully installed rdoc-3.12
Successfully installed railties-3.2.3
Successfully installed bundler-1.1.3
Successfully installed rails-3.2.3
31 gems installed
Installing ri documentation for i18n-0.6.0...
Installing ri documentation for multi_json-1.2.0...
Installing ri documentation for activesupport-3.2.3...
Installing ri documentation for builder-3.0.0...
Installing ri documentation for activemodel-3.2.3...
Installing ri documentation for rack-1.4.1...
Installing ri documentation for rack-cache-1.2...
Installing ri documentation for rack-test-0.6.1...
Installing ri documentation for journey-1.0.3...
Installing ri documentation for hike-1.2.1...
Installing ri documentation for tilt-1.3.3...
Installing ri documentation for sprockets-2.1.2...
Installing ri documentation for erubis-2.7.0...
Installing ri documentation for actionpack-3.2.3...
Installing ri documentation for arel-3.0.2...
Installing ri documentation for tzinfo-0.3.32...
Installing ri documentation for activerecord-3.2.3...
Installing ri documentation for activeresource-3.2.3...
Installing ri documentation for mime-types-1.18...
Installing ri documentation for polyglot-0.3.3...
Installing ri documentation for treetop-1.4.10...
Installing ri documentation for mail-2.4.4...
Installing ri documentation for actionmailer-3.2.3...
Installing ri documentation for rake-0.9.2.2...
Installing ri documentation for thor-0.14.6...
Installing ri documentation for rack-ssl-1.3.2...
Installing ri documentation for json-1.6.6...
Installing ri documentation for rdoc-3.12...
Installing ri documentation for railties-3.2.3...
Installing ri documentation for bundler-1.1.3...
Installing ri documentation for rails-3.2.3...
Installing RDoc documentation for i18n-0.6.0...
Installing RDoc documentation for multi_json-1.2.0...
Installing RDoc documentation for activesupport-3.2.3...
Installing RDoc documentation for builder-3.0.0...
Installing RDoc documentation for activemodel-3.2.3...
Installing RDoc documentation for rack-1.4.1...
Installing RDoc documentation for rack-cache-1.2...
Installing RDoc documentation for rack-test-0.6.1...
Installing RDoc documentation for journey-1.0.3...
Installing RDoc documentation for hike-1.2.1...
Installing RDoc documentation for tilt-1.3.3...
Installing RDoc documentation for sprockets-2.1.2...
Installing RDoc documentation for erubis-2.7.0...
Installing RDoc documentation for actionpack-3.2.3...
Installing RDoc documentation for arel-3.0.2...
Installing RDoc documentation for tzinfo-0.3.32...
Installing RDoc documentation for activerecord-3.2.3...
Installing RDoc documentation for activeresource-3.2.3...
Installing RDoc documentation for mime-types-1.18...
Installing RDoc documentation for polyglot-0.3.3...
Installing RDoc documentation for treetop-1.4.10...
Installing RDoc documentation for mail-2.4.4...
Installing RDoc documentation for actionmailer-3.2.3...
Installing RDoc documentation for rake-0.9.2.2...
Installing RDoc documentation for thor-0.14.6...
Installing RDoc documentation for rack-ssl-1.3.2...
Installing RDoc documentation for json-1.6.6...
Installing RDoc documentation for rdoc-3.12...
Installing RDoc documentation for railties-3.2.3...
Installing RDoc documentation for bundler-1.1.3...
Installing RDoc documentation for rails-3.2.3...
Here are a few things I didn't expect... rails was not added to my path, so I needed to manually add /var/lib/gems/1.8/bin, which I found very annoying. Ruby is starting to remind me of how we were promised Plug'n Play in Windows '95. It wasn't really Plug 'n Play.
kveroneau@sys1:~/ror$ rails new blog
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/initializers/wrap_parameters.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create lib/assets
create lib/assets/.gitkeep
create log
create log/.gitkeep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create script
create script/rails
create test/fixtures
create test/fixtures/.gitkeep
create test/functional
create test/functional/.gitkeep
create test/integration
create test/integration/.gitkeep
create test/unit
create test/unit/.gitkeep
create test/performance/browsing_test.rb
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.gitkeep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.2.0)
Using activesupport (3.2.3)
Using builder (3.0.0)
Using activemodel (3.2.3)
Using erubis (2.7.0)
Using journey (1.0.3)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.2)
Using actionpack (3.2.3)
Using mime-types (1.18)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.3)
Using arel (3.0.2)
Using tzinfo (0.3.32)
Using activerecord (3.2.3)
Using activeresource (3.2.3)
Using bundler (1.1.3)
Using coffee-script-source (1.2.0)
Using execjs (1.3.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.6.6)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.3)
Gem::Exception: Cannot load gem at [/var/lib/gems/1.8/cache/coffee-script-source-1.2.0.gem] in /home/kveroneau/ror/blog
An error occured while installing coffee-script-source (1.2.0), and Bundler cannot continue.
Make sure that `gem install coffee-script-source -v '1.2.0'` succeeds before bundling.
This is the last thing I would expect from one of the world's best web frameworks(or so I have heard), it did this many times before it finally worked. Shouldn't Rails have installed all the required deps via GEM? Or is this not how a package manager is suppose to work? Ruby really is full of surprises, many of which are not user-friendly. Here are the deps I needed to manually install myself:
root@sys1:~# gem install coffee-script-source -v '1.2.0'
Successfully installed coffee-script-source-1.2.0
1 gem installed
Installing ri documentation for coffee-script-source-1.2.0...
Installing RDoc documentation for coffee-script-source-1.2.0...
root@sys1:~# gem install execjs -v '1.3.0'
Successfully installed execjs-1.3.0
1 gem installed
Installing ri documentation for execjs-1.3.0...
Installing RDoc documentation for execjs-1.3.0...
root@sys1:~# gem install coffee-script -v '2.2.0'
Successfully installed coffee-script-2.2.0
1 gem installed
Installing ri documentation for coffee-script-2.2.0...
Installing RDoc documentation for coffee-script-2.2.0...
root@sys1:~# gem install coffee-rails -v '3.2.2'
Successfully installed coffee-rails-3.2.2
1 gem installed
Installing ri documentation for coffee-rails-3.2.2...
Installing RDoc documentation for coffee-rails-3.2.2...
root@sys1:~# gem install jquery-rails -v '2.0.1'
Successfully installed jquery-rails-2.0.1
1 gem installed
Installing ri documentation for jquery-rails-2.0.1...
Installing RDoc documentation for jquery-rails-2.0.1...
root@sys1:~# gem install sass -v '3.1.15'
Successfully installed sass-3.1.15
1 gem installed
Installing ri documentation for sass-3.1.15...
Installing RDoc documentation for sass-3.1.15...
root@sys1:~# gem install sass-rails -v '3.2.5'
Successfully installed sass-rails-3.2.5
1 gem installed
Installing ri documentation for sass-rails-3.2.5...
Installing RDoc documentation for sass-rails-3.2.5...
root@sys1:~# gem install sqlite3 -v '1.3.5'
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.5
1 gem installed
Installing ri documentation for sqlite3-1.3.5...
Installing RDoc documentation for sqlite3-1.3.5...
root@sys1:~# gem install uglifier -v '1.2.4'
Successfully installed uglifier-1.2.4
1 gem installed
Installing ri documentation for uglifier-1.2.4...
Installing RDoc documentation for uglifier-1.2.4...
Now, finally the rails bootstrap application works! It took long enough, and I though I would be done with this, but... I wasn't...
kveroneau@sys1:~/ror/blog$ rake db:create
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
(See full trace by running task with --trace)
This is where I finally got completely stuck and frustrated. I went to the website provided and tried installing therubyracer, and even the rubyrhino, and for some odd reason, rake wasn't able to see either of them... REALLY? I have offically given hope at installing Ruby on Rails, the way I easily installed Python and Django. These are obviously too completely different beasts. I would think, given Rails' reputation, Rails would be the easy one to install, and Django would be the one I need to manually compile and such. This unfortunately gives me yet another reason why I enjoy Python and Django so much, compared to the competition. How do rails developers deal with this ordeal? The installation itself it a pain.
