Domanda

Domanda riguardante i motori montati sui binari. Prima di tutto queste sono le versioni che sto usando;

$ rails -v
  Rails 3.2.1
$ ruby -v
  ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

Creo il motore montato con questo:

$ rails plugin new testEngine --mountable
  create  
  create  README.rdoc
  create  Rakefile
  create  testEngine.gtestEnginepec
  create  MIT-LICENSE
  create  .gitignore
  create  Gemfile
  create  app
  create  app/controllers/testEngine/application_controller.rb
  create  app/helpers/testEngine/application_helper.rb
  create  app/mailers
  create  app/models
  create  app/views/layouts/testEngine/application.html.erb
  create  app/assets/images/testEngine
  create  app/assets/images/testEngine/.gitkeep
  create  config/routes.rb
  create  lib/testEngine.rb
  create  lib/tasks/testEngine_tasks.rake
  create  lib/testEngine/version.rb
  create  lib/testEngine/engine.rb
  create  app/assets/stylesheets/testEngine/application.css
  create  app/assets/javascripts/testEngine/application.js
  create  script
  create  script/rails
  create  test/test_helper.rb
  create  test/testEngine_test.rb
  append  Rakefile
  create  test/integration/navigation_test.rb
  vendor_app  test/dummy

  run  bundle install
  Fetching source index for http://rubygtestEngine.org/
  Using rake (0.9.2.2) 
  Using i18n (0.6.0) 
  Using multi_json (1.1.0) 
  Using activesupport (3.2.1) 
  Using builder (3.0.0) 
  Using activemodel (3.2.1) 
  Using erubis (2.7.0) 
  Using journey (1.0.3) 
  Using rack (1.4.1) 
  Using rack-cache (1.1) 
  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.1) 
  Using mime-types (1.17.2) 
  Using polyglot (0.3.3) 
  Using treetop (1.4.10) 
  Using mail (2.4.1) 
  Using actionmailer (3.2.1) 
  Using arel (3.0.2) 
  Using tzinfo (0.3.31) 
  Using activerecord (3.2.1) 
  Using activeresource (3.2.1) 
  Using bundler (1.0.22) 
  Using rack-ssl (1.3.2) 
  Using json (1.6.5) 
  Using rdoc (3.12) 
  Using thor (0.14.6) 
  Using railties (3.2.1) 
  Using rails (3.2.1) 
  Using testEngine (0.0.1) from source at /private/var/www/html/development/projects/testEngine
  Using jquery-rails (2.0.0) 
  Using sqlite3 (1.3.5) 
  Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Quando utilizzo il comando Rails all'interno della radice del motore (non in DummyApp) ricevo il seguente errore:

$ rails -v
script/rails:7:in `require': no such file to load -- rails/all (LoadError)
from script/rails:7

Questo è il mio file Rails in Script/Rails:

$ cat script/rails 
#!/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_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/ems/engine', __FILE__)

require 'rails/all'
require 'rails/engine/commands'

L'errore indica che il problema deriva dai due binari include nella parte inferiore. C'è qualcosa che posso fare per risolvere questo problema? Senza la possibilità di usare Rails non sono in grado di utilizzare nessuno degli strumenti che il comando Rails mi dà come impalcature ecc.

Qualsiasi aiuto è apprezzato e se hai bisogno di ulteriori informazioni per favore fammelo sapere.

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top