gpt4 book ai didi

ruby-on-rails - 在可安装的 Rails 引擎中使用 rails-assets-angular gem

转载 作者:行者123 更新时间:2023-12-04 03:41:26 25 4
gpt4 key购买 nike

我正在尝试使用 rails-assets-angular 将 AngularJS 引导到 Rails 引擎中 gem 。

但是,当我在父应用程序(安装我的引擎的应用程序)上启动服务器时,出现以下错误:couldn't find file 'angular' .

这是我的 application.js :

//= require angular
//= require_tree .

这是我的 .gemspec :
$:.push File.expand_path("../lib", __FILE__)

# Maintain your gem's version:
require "lesson_notes/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "lesson_notes"
s.version = LessonNotes::VERSION

s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]

s.add_dependency "rails", "~> 4.0.4"
s.add_dependency "rails-assets-angular"

s.add_development_dependency "pg"

s.add_development_dependency "rspec", "~> 2.14.1"
s.add_development_dependency "rspec-rails"
s.add_development_dependency "capybara", "~> 2.2.1"
s.add_development_dependency "factory_girl_rails", "~> 4.0"
s.add_development_dependency "rails-assets-angular-mocks"
s.add_development_dependency "database_cleaner", "~> 1.2.0"

s.test_files = Dir["spec/**/*"]
end

还有我的 Gemfile :
source "https://rubygems.org"
source "https://rails-assets.org"

gemspec

最佳答案

弄清楚了!

lib/engine_name/engine.rb 添加 require "rails-assets-angular" .

关于ruby-on-rails - 在可安装的 Rails 引擎中使用 rails-assets-angular gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23191598/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com