标签: bundle

Rails&Bundler - 安装在rails应用程序中的gem

在新安装的osx rvm之后,运行bundle install的bundler和rails 3以某种方式解压缩了我的应用程序中的所有内容.我做了以下事情:

安装了rvm

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
Run Code Online (Sandbox Code Playgroud)

在bash中添加了以下内容

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.
Run Code Online (Sandbox Code Playgroud)

通过rvm安装红宝石

rvm install 1.9.2
rvm -default 1.9.2
Run Code Online (Sandbox Code Playgroud)

由rubygems安装的导轨

gem install rails
Run Code Online (Sandbox Code Playgroud)

安装捆绑器

gem install bundle
Run Code Online (Sandbox Code Playgroud)

从现有的rails应用程序中安装了我的宝石

bundle install
Run Code Online (Sandbox Code Playgroud)

这将导致在下面的目录结构我的应用程序根目录:

mycoolblog/rails/ruby/1.9.1/bin | bundler | cache | doc | gems | specification 
Run Code Online (Sandbox Code Playgroud)

显然我的安装有问题,但不知道如何修复它.如果我需要在投票结束此问题之前提供更多详细信息,告知我们.

bundle ruby-on-rails bundler

0
推荐指数
1
解决办法
624
查看次数

OSGi:servicereference.getBundle().getVersion() - 没有这样的方法错误

我在我的OSGi应用程序中观察到奇怪的行为.我基本上有几个包提供一个服务接口的实现.消费捆绑包应该使用与特定版本匹配的其中一个捆绑包的实现.

我一直试图通过首先使用服务跟踪器上的过滤器检索所有服务来实现这一目标,如下所示:

serviceTaskTracker = new ServiceTracker(bundleContext, 
bundleContext.createFilter("(objectClass=*ServiceTasks)"), null);
ServiceReference[] serviceReferences = serviceTaskTracker.getServiceReferences();
Run Code Online (Sandbox Code Playgroud)

随后,我在迭代结果集

for (ServiceReference serviceReference : serviceReferences) {
        Bundle currentBundle = serviceReference.getBundle();

        try {
            Version currentVersion = currentBundle.getVersion();
        } catch (Throwable e) {
            System.out.println(e);
            e.printStackTrace();
        }

        if (currentVersion.equals(specifiedVersion)) {
            service = (ServiceTasks) bundleContext.getService(serviceReference);
        }
}
Run Code Online (Sandbox Code Playgroud)

现在它在调用currentBundle.getVersion()时报告"没有这样的方法错误"时崩溃了.这对我来说特别奇怪,因为我可以在Eclipse的调试模式中升级到那一行,突出显示"currentBundle.getVersion()",按CTRL + Shift + D执行它并获得提供包的预期版本.按F6再一步,它会崩溃.

currentBundle.getClass()在我调用getVersion()之前返回"(org.eclipse.osgi.framework.internal.core.BundleHost)".

stacktrace看起来像这样:

java.lang.NoSuchMethodError:org.osgi.framework.Bundle.getVersion()Lorg/osgi/framework/Version; java.lang.NoSuchMethodError:org.osgi.framework.Bundle.getVersion()Lorg/osgi/framework/Version; at de.paas.engine.adapter.activit.PaasServiceTask.getServiceTaskService(PaasServiceTask.java:69)at de.paas.servicetasks.exampleprocess.SendMailTask​​.paasExecute(SendMailTask​​.java:58)at de.paas.engine.adapter.activiti .PaasServiceTask.execute(PaasServiceTask.java:119)org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:115)atg.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute (AtomicOperationActivityExecute.java:44)org.activiti.engine.impl.interctor.CommandContext.performOperation(CommandContext.java:77)org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) )org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)org.activiti.engine.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)at org. activiti.engine.impl.pvm.runtime.Abstrac orE.activiti.engine.impl.permpl上的orE.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77)中的tEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56).ExecutionEntity.performOperationSync(ExecutionEntity. java:530)org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)在org.activiti.engine的org.activiti.engine.impl.interceptor.Command.permplOperation(CommandContext.java:77)org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) org.activiti.engine.impl.interceptor上的org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)中的.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) .CommandContext.perform 操作(CommandContext.java:77)org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity. java:525)org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:65)org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77)at org .activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)在org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)在org.activiti.engine位于org.activiti.engine.impl.persistence.entity的org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77)的.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:115) .ExecutionEntity.performOperationSync(ExecutionEntity.java:530)在org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)在org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd. java:36)org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77)at org .activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)在org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)在org.activiti.engine位于org.activiti.engine.impl.persistence.entity的org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77)的.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)位于org.activiti.engine.impl.persistence.entity.ExecutionEntity.take的org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)的.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) (ExecutionEntity.java:365)org.activiti.engine.bpmn.behavior.ExclusiveGatewayActivityBehavior.leave(ExclusiveGatewayActivityBehavior.java:74)at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java) :36)atg.activiti.engine.imp.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77)at …

osgi bundle

0
推荐指数
1
解决办法
2947
查看次数

我安装了capistrano后,Rails应用程序无法加载

我想在vexxhost上第一次部署我的rails应用程序.我使用github作为我的源代码管理和capistrano.

这是我的部署文件

require 'bundler/capistrano'
require 'capistrano'
require 'bundler'
require 'capistrano-vexxhost'

# Account Settings

ssh_options[:forward_agent] = true
set :scm_command, "/home/user/opt/bin/git"
set :local_scm_command,"git"
set :user, "xxxxxxxx"
set :password, "xxxxxxxxx"
set :domain, "domain.com"
set :mount_path,"/home/xxxxxxxx/xxxxxxx"
set :application,"app name"
set :scm, :git
set :deploy_via, :copy
set :repository, "git@github.com:xxxxx/xxxxxxx.git"
default_run_options[:pty] = true
Run Code Online (Sandbox Code Playgroud)

一旦我安装了gem'capistrano'gem'capistrano-vexxhost',我在尝试在我的笔记本电脑上本地加载我的应用程序时遇到以下错误(它在安装capistrano之前工作).

 C:/Ruby193/lib/ruby/gems/1.9.1/gems/capistrano-2.14.1/lib/capistrano/configuration/loading.rb:18:in `instance': Please require this file from within a Capistrano recipe (LoadError) 
  from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/capistrano.rb:7:in `<top (required)>'
    from C:/Users/mummy/LagoAds/config/application.rb:6:in `require'
    from C:/Users/mummy/LagoAds/config/application.rb:6:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>' …
Run Code Online (Sandbox Code Playgroud)

bundle capistrano ruby-on-rails-3.2 rvm-capistrano

0
推荐指数
1
解决办法
2724
查看次数

什么是"胖束"?

我在OSGi上下文中听到了俚语"胖包",所以我想知道它和普通的OSGi包有什么区别?

osgi bundle

0
推荐指数
1
解决办法
152
查看次数

OSGi如何安装两个完全相同的捆绑?

我想在OSGi容器中两次安装两个相同的bundle或相同的bundle.我使用的OSGi容器是FUSE ESB.这是捆绑信息:

pom.xml中:

<groupId>com.helloworldbundle</groupId>
<artifactId>HelloWorldBundle</artifactId>
<version>1.0.0-SNAPSHOT</version>
Run Code Online (Sandbox Code Playgroud)

蓝图:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

  <bean id="helloworldbundlecopybean"
    class="com.helloworldbundle.HelloWorld"
    init-method="init" destroy-method="destroy">
  </bean>

</blueprint>
Run Code Online (Sandbox Code Playgroud)

第一次安装成功.当我再次尝试安装时,它失败了.然后我制作项目的副本并修改它:

将项目文件夹名称更改为HelloWorldBundleCopy

将工件更改为

<artifactId>HelloWorldBundleCopy</artifactId>
Run Code Online (Sandbox Code Playgroud)

将bean id更改为

<bean id="helloworldbundlecopybeancopy"
Run Code Online (Sandbox Code Playgroud)

但我仍然无法安装修改后的捆绑包:

Error executing command: Error installing bundles:
Unable to install bundle /home/li/Documents/Java/HelloWorldBundleCopy/target/HelloWorldBundleCpoy-1.0.0-SNAPSHOT.jar
Run Code Online (Sandbox Code Playgroud)

更新到我的问题:

这是我的场景:

我有三个主机:Host1,Host2和Host3

FUSE ESB OSGi容器安装在Host3中.我需要在Host1和Host2上运行一个服务,例如HelloWorld.此服务已在Host3上的FUSE ESB中注册.

这就是为什么我需要使用FUSE ESB两次注册相同的包.

这是我的问题:

  1. 是否可以在容器外部运行捆绑包,例如在一台主机上运行HelloWorld捆绑包,但是将其注册到另一台主机上的FUSE ESB?怎么做?我之前做过的实验是通过以下方式在同一台机器上向FUSE ESB注册服务包:

    FuseESB:karaf @ root>安装文件:/home/li/Documents/Java/HelloWorldBundle/target/HelloWorldBundle-1.0.0-SNAPSHOT.jar

2.如何修改现有的maven项目以便在不创建新的maven项目的情况下再次安装它?

java osgi bundle fuseesb

0
推荐指数
1
解决办法
1138
查看次数

Eclipse中的Genymotion

我正在使用Eclipse Bundle SDK制作Android应用程序,但Eclipse的实际ADV非常慢,我找到了Genymotion.

我遵循所有指南,我有同样的问题.

我有所有可配置的,VirtualBox,Genymotion和一些设备以及Eclipse程序的"运行配置".但是当我运行应用程序并尝试选择Genymotion时,这不会出现.我不知道我需要做什么.这是一个例子http://gyazo.com/9d233050af68116d1e2208bab2ed516e

在尝试运行程序之前,我从插件启动了设备.

eclipse sdk bundle genymotion

0
推荐指数
1
解决办法
4227
查看次数

从捆绑包部署捆绑包

我想从OSGI包中启动OSGI包.正如您所看到的,此代码通过从目录部署它来启动bundle:

private void installStartBundle(BundleContext bc, String location, String name) throws BundleException
        {
            debug("installing " + location + "...");
            Bundle[] all = bc.getBundles();
            for (Bundle bundle : all)
            {
                String l = bundle.getLocation();
                if (l.indexOf(name) != -1)
                {
                    debug("already installed bundle " + bundle.getBundleId() + "|" + bundle.getLocation() + ">" + bundle.getSymbolicName());
                    return;
                }
            }

            Bundle b = bc.installBundle(location);
            debug("starting " + b.getSymbolicName());
            b.start();
        }
Run Code Online (Sandbox Code Playgroud)

我注意到一个问题:例如,我有一个包含xml配置文件和主包的包,它通过将其部署到Felix并将包访问到xml包中来加载xml配置文件.

我可以从bundle成功安装bundle,但是依赖包的导出包不可访问.也许部署过程太慢,捆绑加载器无法找到导出的包.知道如何解决这个问题吗?

PS你能告诉我如何检查一个捆绑包是否在Felix中成功部署?

java osgi bundle apache-felix osgi-bundle

0
推荐指数
1
解决办法
150
查看次数

'FirebaseAnalytics.Param.SIGN_UP_METHOD'无法在控制台中将'value'与'Event name`一起保存

我正在使用此代码来分析用户正在使用的sign_up方法:

Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.SIGN_UP_METHOD, "sign_up_method");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SIGN_UP, bundle);
Run Code Online (Sandbox Code Playgroud)

只要用户注册,上面给出的代码就应该将事件保存在Firebase控制台中.

问题是事件正在创建,但value列下没有任何内容,即sign_up_method没有显示.

这是来自控制台的快照(事件名称:sign_up在那里,但代替sign_up_method,有一个-):

在此输入图像描述

这里出了什么问题?

请告诉我.

android bundle firebase firebase-analytics

0
推荐指数
1
解决办法
640
查看次数

Android片段捆绑只获得一个arg

我想将我的片段中的多个值传递给另一个片段.

这是我在片段A中所做的:

mCallback.passData("title","test");
Run Code Online (Sandbox Code Playgroud)

活动:

活动

片段B:

Bundle args = getArguments();
    if(args != null){
        Toast.makeText(getActivity(), args.getString(NAME_RECEIVE), Toast.LENGTH_LONG).show();
        Toast.makeText(getActivity(), args.getString(TITLE_RECEIVE), Toast.LENGTH_LONG).show();
    }
Run Code Online (Sandbox Code Playgroud)

但我只从我的捆绑中得到一个论点

谢谢@ cricket_007

我为NAME_RECEIVE和TITLE_RECEIVE传递了2次相同的字符串:

final static String TITLE_RECEIVE = "data_receive";
final static String NAME_RECEIVE = "data_receive";
Run Code Online (Sandbox Code Playgroud)

android bundle android-intent android-fragments

0
推荐指数
1
解决办法
58
查看次数

Javascript捆绑和模块加载

我最近被抛入清理一个有45-50个单独的.jsjavascript文件的项目.我想知道减少所有装载尺寸的最佳方法是什么.只需将所有文件连接成一个npmgulp?安装一些模块加载器?的WebPack?

javascript bundle npm gulp

0
推荐指数
1
解决办法
227
查看次数