Three RoR questions [solved, and some advice]

Other talk about Salix
Post Reply
GJones
Donor
Posts: 300
Joined: 22. Jul 2011, 23:27

Three RoR questions [solved, and some advice]

Post by GJones »

So I installed Rails with 'gem install'. I set up a chroot, entered it, and attempted to create a new Rails application:

Code: Select all

$ rails new testapp

    Rails 3 doesn't officially support Ruby 1.9.1 since recent stable
    releases have segfaulted the test suite. Please upgrade to Ruby 1.9.2.

    You're running
      ruby 1.9.1p431 (2011-02-18 revision 30908) [x86_64-linux]

      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
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
sudo: must be setuid root
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.3.2) 
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.3) 
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.33) 
Using activerecord (3.2.3) 

Zlib::GzipFile::Error: not in gzip format
An error occured while installing activeresource (3.2.3), and Bundler cannot continue.                                                                          
Make sure that `gem install activeresource -v '3.2.3'` succeeds before bundling.
1. How bad is that "Ruby 1.9.1 is not officially supported" issue? Bad enough to matter on an educational, totally-not-production RoR setup?

2. Do the complaints about sudo matter? What does RoR need sudo for, anyway? Note that suid is disabled for binaries in the chroot.

3. Most importantly, why is activeresource not in gzip format? And how can I automatically snag all the dependencies I need? Shouldn't 'gem install rails' have gotten all of those?0
Last edited by GJones on 3. May 2012, 02:37, edited 2 times in total.
GJones
Donor
Posts: 300
Joined: 22. Jul 2011, 23:27

Re: Three RoR questions

Post by GJones »

As usual, it turns out problems 2 and 3 were the result of an ID10T error on my par. They are of course related; bundle invokes sudo to install necessary gems to the root filesystem, and sudo won't work in a chroot where everything's mounted ro,nosuid. This results in mysterious failures unless you install a bunch of gems manually. Duh!

(Also, using Rails with Ruby 1.9.1 does indeed result in a segfault.)

BTW - am I the only one who finds it rather odd that Rails expects you to create applications as a user with sudo privileges? I assume the implication is that you should to create the application as a privileged user, then stick it in a directory belonging to an unprivileged one, and apply the correct permissions before starting Mongrel... Because in a production environment, I would think that running your server as a user with sudo privileges would be strongly discouraged to say the least.
User avatar
deja69
Posts: 89
Joined: 23. Apr 2012, 00:20

Re: Three RoR questions [solved]

Post by deja69 »

:D
Sorry you dont qualify as an ID1OT - you learnt from your errors ;)

The bewildered repeat them.
And true ID1OTs never make them at all :P

Glad you got your Rubys shiny,maybe the oddities are just Japanese wisdom?
GJones
Donor
Posts: 300
Joined: 22. Jul 2011, 23:27

Re: Three RoR questions [solved]

Post by GJones »

Also a bit of advice for Ruby fans on Salix: don't bother with the prepackaged version of Ruby, it's horribly bugged. Use RVM instead. It is absurdly more convenient.

(Just remember to make xterm use a login shell, or it won't work!)
Post Reply