小编Tha*_*tta的帖子

没有"框架:茉莉花"的提供者!(解决:框架:茉莉花)

当我运行命令时,grunt我收到以下警告:

Running "karma:unit" (karma) task
Warning: No provider for "framework:jasmine"! (Resolving: framework:jasmine) Use --force to continue.
Run Code Online (Sandbox Code Playgroud)

有人知道如何解决这个问题吗?

gruntjs karma-jasmine

98
推荐指数
5
解决办法
4万
查看次数

Selenium :: WebDriver :: Error :: JavascriptError:arguments [0]未定义

看到这是Firefox 35的一个问题后,我安装了34并运行bundle exec rspec,我的测试运行完美.但是当我再次尝试运行它时,它以某种方式打开了较新版本的Firefox,因为当我运行我的测试套件时再次出现以下错误:

 Selenium::WebDriver::Error::JavascriptError: arguments[0] is undefined
Run Code Online (Sandbox Code Playgroud)

有没有办法保证我没有安装Firefox 35,Selenium会以某种方式找到并打开?我知道Firefox 34是我Applications目录中Firefox的版本,但我不确定是否有新的firefox的副本副本,Selenium在launchy使用时会抓取它.

firefox selenium rspec

18
推荐指数
2
解决办法
4136
查看次数

向子视图添加约束会使背景颜色不显示

所以我使用自定义函数来格式化我添加到a的子视图UICollectionViewCell.它来自Brian Voong的公共项目:https://github.com/purelyswift/facebook_feed_dynamic_cell_content/blob/master/facebookfeed2/ViewController.swift.

func addConstraintsWithFormat(format: String, views: UIView...) {
   var viewsDictionary = [String: UIView]()
   for (index, view) in views.enumerate() {
      let key = "v\(index)"
      viewsDictionary[key] = view
      view.translatesAutoresizingMaskIntoConstraints = false
   }
   addConstraints(NSLayoutConstraint.constraintsWithVisualFormat(format, options: NSLayoutFormatOptions(), metrics: nil, views: viewsDictionary))
}
Run Code Online (Sandbox Code Playgroud)

有趣的是,在我的UICollectionViewI中添加一个SubView单元格,并将背景颜色设置为白色.当我注释掉设置子视图背景的线时,背景为白色,当我取消注释设置子视图的可视格式约束的线时,没有设置背景颜色.

以下两行相互冲突:

func chronicleOneClicked(sender: UIButton) {
   point1view.backgroundColor = UIColor.whiteColor()

   addSubview(point1view)
   //When the below is commented the background of point1view disappears   
   //addConstraintsWithFormat("|-50-[v0]-50-|", views: point1view)
}
Run Code Online (Sandbox Code Playgroud)

当我这样做时,print(subviews)我看到UIView白色背景颜色是视图堆栈中最高的(堆栈顶部).当我打印出来时,subviews[subviews.count-1].backgroundColor我得到的Optional(UIDeviceWhiteColorSpace …

uiview ios swift

15
推荐指数
1
解决办法
2024
查看次数

使用未解析的标识符'GGLContext'

我在我的ios Swift应用程序中集成了Google Sign-In.我在此处关注谷歌开发者页面上的官方说明(https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift)

这是我的桥接标题:

#ifndef Header_h
#define Header_h


#endif /* Header_h */

#import <CommonCrypto/CommonCrypto.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <GoogleSignIn/GoogleSignIn.h>
Run Code Online (Sandbox Code Playgroud)

当我在我的AppDelegate.swift函数中调用该行时

    GGLContext.sharedInstance().configureWithError(&configureError)
Run Code Online (Sandbox Code Playgroud)

在里面.它说

 Use of unresolved identifier 'GGLContext'
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏.

ios google-signin

14
推荐指数
2
解决办法
7214
查看次数

npm ERR:peerinvalid package generator-karma不满足其兄弟姐妹peerDependencies的要求

我跑的时候

 npm install -g yo grunt-cli bower
Run Code Online (Sandbox Code Playgroud)

在我的终端,我得到以下依赖性错误:

npm ERR! peerinvalid The package generator-karma does not satisfy its siblings'
peerDependencies requirements!
npm ERR! peerinvalid Peer generator-angular@0.5.0 wants generator-karma@~0.5.0
npm ERR! System Darwin 12.4.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "yo" "grunt-cli" "bower"
npm ERR! cwd /Users/ryanwieghard/code/angin/indie-cinema-tools
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/ryanwieghard/code/angin/indie-cinema-tools/npm-debug.log
npm ERR! not ok code …
Run Code Online (Sandbox Code Playgroud)

yeoman bower

12
推荐指数
3
解决办法
1万
查看次数

Rails 4:调用ActionMailer时的Net :: ReadTimeout

当我在开发模式下运行我的邮件程序时,我收到以下错误:

Net::ReadTimeout in SchoolApplicationsController#create
Run Code Online (Sandbox Code Playgroud)

这是获取超时的控制器方法

  def create
    @school_application = SchoolApplication.new(school_application_params)
     @school_application.program_cost =    @school_application.calculate_cost_to_charge(params[:school_application][:program], params[:school_application][:duration])
    if @school_application.save
      Rails.logger.debug("Hey mufugga")
      NotificationsMailer.send_application(@school_application).deliver
      redirect_to application_path(@school_application.id)
    else  
      Rails.logger.debug(@school_application.errors.full_messages)
          @school_application.errors.full_messages.each do |msg|
        flash.now[:error] = msg
      end
      render action: "new"
    end
  end
Run Code Online (Sandbox Code Playgroud)

我很肯定错误是由NotificationsMailer调用引起的,因为当我发表评论时,我不再收到错误.

这是我的邮件和设置:

class NotificationsMailer < ActionMailer::Base

  default :from => "from@fls.net"
  default :to => "ryan@fls.net"

  def send_application(application)
    @application = application 
    mail(:subject => "New Application")
  end
end
Run Code Online (Sandbox Code Playgroud)

这是我的environments/development.rbsmtp设置:

Fls::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # In …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails actionmailer

12
推荐指数
2
解决办法
7269
查看次数

Capybara:NotSupportedByDriverError在尝试模拟按<ENTER>时

我正在使用Capybara编写一个规范来测试我网站上搜索栏的功能.按照本页上有关如何模拟按Rspec/Capybara中的Enter键的说明操作后,运行测试时出现以下错误:

 Failure/Error: page.driver.execute_script(keypress)
 Capybara::NotSupportedByDriverError:
   Capybara::Driver::Base#execute_script
Run Code Online (Sandbox Code Playgroud)

难道我做错了什么?以下是我的spec文件的内容:

require 'spec_helper'

describe 'Search' do
  it 'displays no results when non-existent things are looked up'   do

  visit root_path

  page.first(".search-icon-small").click

  fill_in "search", with: "NonExistent"

  #simulate pressing Enter
  keypress ="var e = $.Event('keydown', { keyCode: 13 }); $('body').trigger(e);"
  page.driver.execute_script(keypress)

  page.should have_content('No Results')
  end

  it 'displays content that exists' do
    #Clients
    client = Client.new
    client.name = 'Gerard Leskovar'
    client.save!

    visit root_path


    page.first(".search-icon-small").click

    fill_in "search", with: "Leskovar"

    keypress ="var e = $.Event('keydown', { keyCode: 13 }); …
Run Code Online (Sandbox Code Playgroud)

rspec ruby-on-rails capybara

10
推荐指数
1
解决办法
6152
查看次数

Rspec/Rails:未初始化的常量ActiveSupport :: Autoload(NameError)

我正在尝试运行,bundle exec rspec但是在我的调用中遇到了以下错误spec_helper.rb

template.rb:8:in `<class:Template>': uninitialized constant ActiveSupport::Autoload (NameError)
Run Code Online (Sandbox Code Playgroud)

这是我的spec_helper.rb档案:

require 'rubygems'
require 'rspec/rails'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)   
RSpec.configure do |config|
  config.infer_spec_type_from_file_location!
end
Run Code Online (Sandbox Code Playgroud)

rspec ruby-on-rails

7
推荐指数
1
解决办法
4615
查看次数

状态栏字体颜色未同步更改

我改变了decorView我的window基本上切换之间View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR是真与假,这取决于我的观点的滚动位置。

由于我要同时更改ActionBar和状态Bar,因此我希望这两项更改至少应是瞬时的。但是我注意到在window.decorView.systemUiVisibility = newIntWithToggledLightMode执行和渲染新的状态栏模式之间存在50ms的延迟。我不想将我的工具栏更改放置在postDelay处理程序中,只是为了与状态栏更改协调它们的同时出现。我以为可以onSystemUiVisibilityChangeInterface更新状态栏ui时通知我,但只有在使状态栏不可见时才触发,而不仅仅是更改外观模式。是否有人遇到过这种情况,并提出了更优雅的解决方案?

android

7
推荐指数
1
解决办法
208
查看次数

Haskell:使用列表解析解析错误(可能是错误的缩进或括号不匹配)

我是Haskell的新手,我正在尝试编写一个简单的列表理解并将其分配给变量.这是我的haskell.hs档案:

--find all multiples of 3 and 5 under 1000
multiples :: [Int]
let multiples = [x | x <- [1..1000], (x `mod` 5 == 0) || (x `mod` 3 == 0)]
Run Code Online (Sandbox Code Playgroud)

然后,当我尝试编译程序时,ghc haskell.hs我收到以下错误:

haskell.hs:12:1:
    parse error (possibly incorrect indentation or mismatched brackets)
Run Code Online (Sandbox Code Playgroud)

问候!

haskell

6
推荐指数
1
解决办法
7418
查看次数