Skip to content

Instantly share code, notes, and snippets.

@hannahwhy
Created March 22, 2010 03:43
Show Gist options
  • Select an option

  • Save hannahwhy/339784 to your computer and use it in GitHub Desktop.

Select an option

Save hannahwhy/339784 to your computer and use it in GitHub Desktop.

Environment

yipdw@vm0:~/src/issue-210$ ruby -v
ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01

yipdw@vm0: ~/src/issue-210$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/yipdw/ree/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /home/yipdw/ree/bin/ruby
  - EXECUTABLE DIRECTORY: /home/yipdw/ree/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/yipdw/ree/lib/ruby/gems/1.8
     - /home/yipdw/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Install Bundler

yipdw@vm0:~/src/issue-210$ gem install bundler --no-rdoc --no-ri
Successfully installed bundler-0.9.12
1 gem installed

yipdw@vm0:~/src/issue-210$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
bundler (0.9.12)
fastthread (1.0.7)
passenger (2.2.11)
rack (1.1.0, 1.0.1)
rails (2.3.5)
rake (0.8.7)
rubygems-update (1.3.6)
sqlite3-ruby (1.2.5)

Create Rails application

yipdw@vm0:~/src/issue-210$ rails -m http://gist.github.com/raw/338169/3a1d8e8eb1dde41479d2606019c0df031df7d872/rails23-bundler-template.rb foo

      create  
      create  app/controllers
      create  app/helpers
      create  app/models
      create  app/views/layouts
      create  config/environments
      create  config/initializers
      create  config/locales
      create  db
      create  doc
      create  lib
      create  lib/tasks
      create  log
      create  public/images
      create  public/javascripts
      create  public/stylesheets
      create  script/performance
      create  test/fixtures
      create  test/functional
      create  test/integration
      create  test/performance
      create  test/unit
      create  vendor
      create  vendor/plugins
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  Rakefile
      create  README
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  config/database.yml
      create  config/routes.rb
      create  config/locales/en.yml
      create  db/seeds.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/new_rails_defaults.rb
      create  config/initializers/session_store.rb
      create  config/environment.rb
      create  config/boot.rb
      create  config/environments/production.rb
      create  config/environments/development.rb
      create  config/environments/test.rb
      create  script/about
      create  script/console
      create  script/dbconsole
      create  script/destroy
      create  script/generate
      create  script/runner
      create  script/server
      create  script/plugin
      create  script/performance/benchmarker
      create  script/performance/profiler
      create  test/test_helper.rb
      create  test/performance/browsing_test.rb
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/index.html
      create  public/favicon.ico
      create  public/robots.txt
      create  public/images/rails.png
      create  public/javascripts/prototype.js
      create  public/javascripts/effects.js
      create  public/javascripts/dragdrop.js
      create  public/javascripts/controls.js
      create  public/javascripts/application.js
      create  doc/README_FOR_APP
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log
    applying  template: http://gist.github.com/raw/338169/3a1d8e8eb1dde41479d2606019c0df031df7d872/rails23-bundler-template.rb
        file  config/preinitializer.rb
        file  Gemfile
   executing  bundle install --relock from /home/yipdw/src/issue-210/foo
     applied  http://gist.github.com/raw/338169/3a1d8e8eb1dde41479d2606019c0df031df7d872/rails23-bundler-template.rb

Write Gemfile

yipdw@vm0:~/src/issue-210$ cd foo/

yipdw@vm0:~/src/issue-210/foo$ echo "source :gemcutter
> gem 'rails', '2.3.5', :require => nil
> gem 'sqlite3-ruby'
> gem 'rspec-rails'
> " > Gemfile

Install and lock bundle

yipdw@vm0:~/src/issue-210/foo$ bundle install --relock
Fetching source index from http://gemcutter.org/
Resolving dependencies
Installing rake (0.8.7) from system gems 
Installing activesupport (2.3.5) from system gems 
Installing rack (1.0.1) from system gems 
Installing actionpack (2.3.5) from system gems 
Installing actionmailer (2.3.5) from system gems 
Installing activerecord (2.3.5) from system gems 
Installing activeresource (2.3.5) from system gems 
Installing rails (2.3.5) from system gems 
Installing rspec (1.3.0) from rubygems repository at http://gemcutter.org/ 
Installing rspec-rails (1.3.2) from rubygems repository at http://gemcutter.org/ 
Installing sqlite3-ruby (1.2.5) from system gems 
Your bundle is complete!
The bundle is now locked. Use `bundle show` to list the gems in the environment.

Try out generators

yipdw@vm0:~/src/issue-210/foo$ script/generate rspec_model bar
Couldn't find 'rspec_model' generator

yipdw@vm0:~/src/issue-210/foo$ bundle exec script/generate rspec_model bar
Couldn't find 'rspec_model' generator

yipdw@vm0:~/src/issue-210/foo$ bundle show rspec-rails
/home/yipdw/.bundle/ruby/1.8/gems/rspec-rails-1.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment