我最近将支持设计库更新到最新版本,现在每个具有 CollapsingToolbarLayout 的 Activity 都会引发以下异常:
java.lang.NoSuchMethodError: No static method setLayoutDirection(Landroid/graphics/drawable/Drawable;I)V in class Landroid/support/v4/graphics/drawable/DrawableCompat; or its super classes (declaration of 'android.support.v4.graphics.drawable.DrawableCompat' appears in /data/data/com.radioafrica.music/files/instant-run/dex/slice-com.android.support-support-v4-24.0.0-beta1_f8cf3ba4c70f87f407a745b9fa14a2205d0b587c-classes.dex)
完整的错误日志如下:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.radioafrica.music/com.radioafrica.music.activity.PlaylistTracks}: android.view.InflateException: Binary XML file line #31: Binary XML file line #31: Error inflating class android.support.design.widget.CollapsingToolbarLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NoSuchMethodError: No static method setLayoutDirection(Landroid/graphics/drawable/Drawable;I)V in class Landroid/support/v4/graphics/drawable/DrawableCompat; or its super classes (declaration of 'android.support.v4.graphics.drawable.DrawableCompat' appears in /data/data/com.radioafrica.music/files/instant-run/dex/slice-com.android.support-support-v4-24.0.0-beta1_f8cf3ba4c70f87f407a745b9fa14a2205d0b587c-classes.dex)
at android.support.design.widget.CollapsingToolbarLayout.setStatusBarScrim(CollapsingToolbarLayout.java:663)
at android.support.design.widget.CollapsingToolbarLayout.<init>(CollapsingToolbarLayout.java:197)
at android.support.design.widget.CollapsingToolbarLayout.<init>(CollapsingToolbarLayout.java:132)
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
我似乎无法找到问题所在...
布局文件为:
`
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="280dip"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="@drawable/no_cover"
android:transitionName="avatar"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.github.glomadrian.loadingballs.BallView
android:id="@+id/ballView"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="150dip"
lib:ball_colors="@array/color"
lib:balls="5"
lib:enable_size_animation="true"
lib:max_ball_size="12dp"
lib:min_ball_size="5dp"
lib:movement_cycle_time="1500"
lib:size_cycle_time="500" />
<android.support.v4.widget.NestedScrollView
android:id="@+id/nestedScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:visibility="gone"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="0dip"
card_view:cardElevation="2dip"
card_view:cardPreventCornerOverlap="true">
<LinearLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dip">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="#fff"
android:layout_marginBottom="10dip"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/owner"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="#e2e2e2" />
</LinearLayout>
</android.support.v7.widget.CardView>
<com.radioafrica.music.view.ExpandableHeightListView
android:id="@+id/top_tracks"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#90ffffff"
android:dividerHeight="1dip"
android:focusable="false"
android:footerDividersEnabled="true"
android:headerDividersEnabled="true" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingPlayButton"
style="@style/FabStyle"
app:layout_anchor="@id/app_bar_layout"
app:layout_anchorGravity="bottom|right|end" />
<include layout="@layout/mini_player" />
`
Activity 代码为:
public class AlbumInfo extends AppCompatActivity implements AdapterView.OnItemClickListener, View.OnClickListener {
public static final String ALBUM = "album";
private ExpandableHeightListView expandableHeightListView;
private NestedScrollView nestedScrollView;
private ImageView header;
private BallView ballView;
private LinearLayout layout;
private LinearLayout miniPlayer;
private TextView title, artistTextView;
private ImageButton playPause;
private ImageView artwork;
private CollapsingToolbarLayout collapsingToolbarLayout;
ImageButton previous;
ImageButton next;
TextView name;
TextView owner;
FloatingActionButton fab;
String songTitle;
String singer;
String art;
boolean playing = false;
private ArrayList<Track> trackList;
private Album album;
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(UIEvent uiEvent) {
miniPlayer.setVisibility(View.VISIBLE);
miniPlayer.setClickable(true);
songTitle = uiEvent.title;
singer = uiEvent.artist;
art = uiEvent.art;
playing = uiEvent.playing;
togglePlayButtonState();
updateViews();
}
private void updateViews() {
Picasso.with(this).load(art).fit().centerCrop().placeholder(R.drawable.no_cover).error(R.drawable.no_cover).into(artwork);
if (NakedGroove.getMediaType().equals(NakedGroove.RADIO)) {
artistTextView.setText(Html.fromHtml(singer));
title.setText(songTitle);
} else {
artistTextView.setText(singer);
title.setText(songTitle);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(TracksEvent tracksEvent) {
trackList = tracksEvent.tracks;
if (trackList.size() != 0) {
ArtistTracksAdapter artistTracksAdapter = new ArtistTracksAdapter(AlbumInfo.this, R.layout.album_tracks_layout, trackList);
expandableHeightListView.setAdapter(artistTracksAdapter);
if (ballView != null) {
ballView.setVisibility(View.GONE);
nestedScrollView.setVisibility(View.VISIBLE);
}
}
}
private Target target = new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
header.setImageBitmap(bitmap);
setColors(bitmap);
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
Picasso.with(AlbumInfo.this).load(album.getAlbumArt()).into(target);
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.no_cover);
header.setImageBitmap(bitmap);
setColors(bitmap);
}
};
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
initActivityTransitions();
setStatusBarColor();
super.onCreate(savedInstanceState);
setContentView(R.layout.album);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
assert getSupportActionBar() != null;
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
album = getIntent().getParcelableExtra(ALBUM);
fetchAlbumTracks(album.getId());
expandableHeightListView = (ExpandableHeightListView) findViewById(R.id.top_tracks);
nestedScrollView = (NestedScrollView) findViewById(R.id.nestedScrollView);
header = (ImageView) findViewById(R.id.header);
ballView = (BallView) findViewById(R.id.ballView);
name = (TextView) findViewById(R.id.name);
owner = (TextView) findViewById(R.id.owner);
layout = (LinearLayout) findViewById(R.id.layout);
fab = (FloatingActionButton) findViewById(R.id.floatingPlayButton);
collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
title = (TextView) findViewById(R.id.title);
artistTextView = (TextView) findViewById(R.id.artist);
previous = (ImageButton) findViewById(R.id.notification_base_previous);
playPause = (ImageButton) findViewById(R.id.notification_base_play);
next = (ImageButton) findViewById(R.id.notification_base_next);
artwork = (ImageView) findViewById(R.id.notification_base_image);
miniPlayer = (LinearLayout) findViewById(R.id.mini_player);
collapsingToolbarLayout.setTitle(album.getTitle());
collapsingToolbarLayout.setExpandedTitleColor(getResources().getColor(android.R.color.transparent));
owner.setText(album.getArtist());
name.setText(album.getTitle());
fab.setOnClickListener(this);
fab.setRippleColor(getResources().getColor(R.color.app_theme_dark));
miniPlayer.setOnClickListener(this);
previous.setOnClickListener(this);
next.setOnClickListener(this);
playPause.setOnClickListener(this);
expandableHeightListView.setExpanded(true);
expandableHeightListView.setOnItemClickListener(this);
if (album.getAlbumArt().length() != 0)
Picasso.with(this).load(album.getAlbumArt()).into(target);
else
Picasso.with(this).load(R.drawable.no_cover).into(target);
if (NakedGroove.isPlaying() || NakedGroove.isPaused()) {
miniPlayer.setVisibility(View.VISIBLE);
togglePlayButtonState();
} else {
miniPlayer.setVisibility(View.GONE);
}
}
private void setStatusBarColor() {
Window window = getWindow();
if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21)
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
if (Build.VERSION.SDK_INT >= 21)
getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent));
}
private void fetchAlbumTracks(String id) {
startService(new Intent(this, RefresherService.class).setAction(RefresherService.FETCH_ALBUM_TRACKS).putExtra(RefresherService.ALBUM_ID, id));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
super.onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
togglePlayButtonState();
if (NakedGroove.getMediaType() != null && !NakedGroove.getMediaType().equals(NakedGroove.NOTHING)) {
updateViews();
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(ALBUM, album.getTitle());
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
NakedGroove.setCurrentPlaylist(trackList);
NakedGroove.setCurrentIndex(position);
if (Build.VERSION.SDK_INT >= 16)
startService(new Intent(this, PlayerService.class).setAction(PlayerService.ACTION_URL));
else
startService(new Intent(this, MusicService.class).setAction(MusicService.ACTION_URL));
}
private void playPauseMusic() {
if (NakedGroove.isPlaying()) {
if (Build.VERSION.SDK_INT >= 16)
startService(new Intent(this, PlayerService.class).setAction(PlayerService.ACTION_PAUSE));
else
startService(new Intent(this, MusicService.class).setAction(MusicService.ACTION_PAUSE));
} else {
if (Build.VERSION.SDK_INT >= 16)
startService(new Intent(this, PlayerService.class).setAction(PlayerService.ACTION_PLAY));
else
startService(new Intent(this, MusicService.class).setAction(MusicService.ACTION_PLAY));
}
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.mini_player:
startActivity(new Intent(this, MusicPlayer.class));
break;
case R.id.notification_base_play:
playPauseMusic();
break;
case R.id.notification_base_next:
if (Build.VERSION.SDK_INT >= 16)
startService(new Intent(this, PlayerService.class).setAction(PlayerService.ACTION_SKIP));
else
startService(new Intent(this, MusicService.class).setAction(MusicService.ACTION_SKIP));
break;
case R.id.notification_base_previous:
if (Build.VERSION.SDK_INT >= 16)
startService(new Intent(this, PlayerService.class).setAction(PlayerService.ACTION_PREVIOUS));
else
startService(new Intent(this, MusicService.class).setAction(MusicService.ACTION_PREVIOUS));
break;
case R.id.floatingPlayButton:
if (trackList.size() != 0) {
NakedGroove.setCurrentPlaylist(trackList);
NakedGroove.setCurrentIndex(0);
if (Build.VERSION.SDK_INT >= 16)
startService(new Intent(this, PlayerService.class).setAction(PlayerService.ACTION_URL));
else
startService(new Intent(this, MusicService.class).setAction(MusicService.ACTION_URL));
}
break;
}
}
private void togglePlayButtonState() {
if (playing) {
playPause.setImageResource(R.drawable.ic_music_pause);
} else {
playPause.setImageResource(R.drawable.ic_music_play);
}
}
private void initActivityTransitions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ChangeBounds transition = new ChangeBounds();
transition.excludeTarget(android.R.id.statusBarBackground, true);
getWindow().setEnterTransition(transition);
getWindow().setReturnTransition(transition);
}
}
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
@Override
protected void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
protected void onStop() {
EventBus.getDefault().unregister(this);
super.onStop();
}
private void setColors(Bitmap bitmap) {
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
@Override
public void onGenerated(Palette palette) {
if (palette.getVibrantSwatch() != null) {
Palette.Swatch vibrantSwatch = palette.getVibrantSwatch();
float[] vibrant = vibrantSwatch.getHsl();
nestedScrollView.setBackgroundColor(Color.HSVToColor(vibrant));
layout.setBackgroundColor(Color.HSVToColor(vibrant));
collapsingToolbarLayout.setContentScrimColor(Color.HSVToColor(vibrant));
collapsingToolbarLayout.setStatusBarScrimColor(Color.HSVToColor(vibrant));
} else if (palette.getDarkVibrantSwatch() != null) {
Palette.Swatch darkVibrantSwatch = palette.getDarkVibrantSwatch();
float[] darkVibrant = darkVibrantSwatch.getHsl();
nestedScrollView.setBackgroundColor(Color.HSVToColor(darkVibrant));
layout.setBackgroundColor(Color.HSVToColor(darkVibrant));
collapsingToolbarLayout.setContentScrimColor(Color.HSVToColor(darkVibrant));
collapsingToolbarLayout.setStatusBarScrimColor(Color.HSVToColor(darkVibrant));
} else if (palette.getDarkMutedSwatch() != null) {
Palette.Swatch darkMutedSwatch = palette.getDarkMutedSwatch();
float[] darkMuted = darkMutedSwatch.getHsl();
nestedScrollView.setBackgroundColor(Color.HSVToColor(darkMuted));
layout.setBackgroundColor(Color.HSVToColor(darkMuted));
collapsingToolbarLayout.setContentScrimColor(Color.HSVToColor(darkMuted));
collapsingToolbarLayout.setStatusBarScrimColor(Color.HSVToColor(darkMuted));
} else {
nestedScrollView.setBackgroundColor(getResources().getColor(R.color.DeepGrey));
layout.setBackgroundColor(getResources().getColor(R.color.DeepGrey));
collapsingToolbarLayout.setContentScrimColor(getResources().getColor(R.color.DeepGrey));
collapsingToolbarLayout.setStatusBarScrimColor(getResources().getColor(R.color.DeepGrey));
}
supportStartPostponedEnterTransition();
}
});
}
}
最佳答案
找到解决方案。只需添加
app:statusBarScrim="@null"
到您的 CollapsingToolbarLayout
关于android - 膨胀 CollapsingToolbarLayout 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37386448/
我正在用Ruby编写一个简单的程序来检查域列表是否被占用。基本上它循环遍历列表,并使用以下函数进行检查。require'rubygems'require'whois'defcheck_domain(domain)c=Whois::Client.newc.query("google.com").available?end程序不断出错(即使我在google.com中进行硬编码),并打印以下消息。鉴于该程序非常简单,我已经没有什么想法了-有什么建议吗?/Library/Ruby/Gems/1.8/gems/whois-2.0.2/lib/whois/server/adapters/base.
我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po
我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file
我正在使用Postgres.app在OSX(10.8.3)上。我已经修改了我的PATH,以便应用程序的bin文件夹位于所有其他文件夹之前。Rammy:~phrogz$whichpg_config/Applications/Postgres.app/Contents/MacOS/bin/pg_config我已经安装了rvm并且可以毫无错误地安装pggem,但是当我需要它时我得到一个错误:Rammy:~phrogz$gem-v1.8.25Rammy:~phrogz$geminstallpgFetching:pg-0.15.1.gem(100%)Buildingnativeextension
我最近对我的计算机(OS-MacOSX10.6.8)进行了删除,并且我正在重新安装我所有的开发工具。我再次安装了RVM;但是,它不会让我安装Ruby1.9.3。到目前为止我已经尝试过:rvminstall1.9.3rvm安装1.9.3-p194rvm安装1.9.3-p448rvminstall1.9.3--with-gcc=clang所有返回相同的命令行错误:Searchingforbinaryrubies,thismighttakesometime.Nobinaryrubiesavailablefor:osx/10.6/x86_64/ruby-1.9.3-p448.Continuin
最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路
我正在尝试为我的iOS应用程序设置cocoapods但是当我执行命令时:sudogemupdate--system我收到错误消息:当前已安装最新版本。中止。当我进入cocoapods的下一步时:sudogeminstallcocoapods我在MacOS10.8.5上遇到错误:ERROR:Errorinstallingcocoapods:cocoapods-trunkrequiresRubyversion>=2.0.0.我在MacOS10.9.4上尝试了同样的操作,但出现错误:ERROR:Couldnotfindavalidgem'cocoapods'(>=0),hereiswhy:U
我刚刚安装了Sphinx(发行版:archlinux)并下载了源代码。然后我为Rails安装了“ThinkingSphinx”插件。我关注了officialpagesetup和thisScreencastfromRyanBates,但是当我尝试为模型建立索引时,出现了这个错误:$rakethinking_sphinx:index(in/home/benoror/Dropbox/Proyectos/cotizahoy)Sphinxcannotbefoundonyoursystem.Youmayneedtoconfigurethefollowingsettingsinyourconfig/
我试图在我的网站上实现使用Facebook登录功能,但在尝试从Facebook取回访问token时遇到障碍。这是我的代码:ifparams[:error_reason]=="user_denied"thenflash[:error]="TologinwithFacebook,youmustclick'Allow'toletthesiteaccessyourinformation"redirect_to:loginelsifparams[:code]thentoken_uri=URI.parse("https://graph.facebook.com/oauth/access_token
尝试使用rubytest/test_foo.rb运行minitest单元测试时出现以下错误:Warning:youshouldrequire'minitest/autorun'instead.Warning:oradd'gem"minitest"'before'require"minitest/autorun"'From:/home/emile/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/minitest/autorun.rb:15:```test_foo.rb看起来像这样:require'minitest/autorun'classTestFoo