Skip to content

Instantly share code, notes, and snippets.

@johanb
Created March 29, 2012 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johanb/2239208 to your computer and use it in GitHub Desktop.
Save johanb/2239208 to your computer and use it in GitHub Desktop.
require 'rubygems'
gemfile = File.expand_path("../../../../Gemfile", __FILE__)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
bundle exec rake test_app
Generating dummy Rails application...
Setting up dummy database...
Couldn't drop db/dummy_test : #<Errno::ENOENT: No such file or directory - /Users/johanbruning/Documents/Development/current/spree_mollie/spec/dummy/db/dummy_test>
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.spree/order" is no longer supported
bundle exec rake test_app 14.49s user 1.48s system 97% cpu 16.308 total
rails g resource item
/Users/johanbruning/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- /Users/johanbruning/Documents/Development/current/spree_mollie/config/boot (LoadError)
from /Users/johanbruning/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from script/rails:4:in `<main>'
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
@johanb
Copy link
Author

johanb commented Mar 29, 2012

Solution:

script/rails should be:

#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.

ENGINE_PATH = File.expand_path('../..',  __FILE__)
load File.expand_path('../../spec/dummy/script/rails',  __FILE__)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment