我正在尝试设置gitlab,从而使用sudo从另一个用户帐户安装一些宝石,但我经常遇到Permission denied错误.
sudo -u gitlab -H bundle install --deployment --without development test postgres
> Using ... ( a lot of successful gems there )
> Using pygments.rb (0.3.2) from https://github.com/gitlabhq/pygments.rb.git (at master)
> Errno::EACCES: Permission denied - pygments.rb-0.3.2.gem
> An error occurred while installing pygments.rb (0.3.2), and Bundler cannot continue.
> Make sure that `gem install pygments.rb -v '0.3.2'` succeeds before bundling.\
sudo -u gitlab -H gem install pygments.rb -v '0.3.2'
> Successfully installed pygments.rb-0.3.2
> 1 gem …Run Code Online (Sandbox Code Playgroud) 我一直试图让RoR与Passenger和Nginx合作.男人这是一次冒险.我终于让服务器运行了,它正在托管一个测试站点,好吧.我遇到了资产错误.我无法使用编译application.js bundle exec rake assets:precompile.以下是--trace的结果:
$ bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/pstachof/.rvm/rubies/ruby-1.9.3-head/bin/ruby /Users/pstachof/.rvm/gems/ruby-1.9.3-head@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
TypeError: 'undefined' is not a function (evaluating 'define.globalDomain.require.bind(define.globalDomain)')
(in /Users/pstachof/.webserver/sites/stachtest1/app/assets/javascripts/application.js)
/Users/pstachof/.rvm/gems/ruby-1.9.3-head/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:68:in `extract_result'
/Users/pstachof/.rvm/gems/ruby-1.9.3-head/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:28:in `block in exec'
/Users/pstachof/.rvm/gems/ruby-1.9.3-head/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile' …Run Code Online (Sandbox Code Playgroud) 请不要链接到如何为Bundle公开语义配置
事实上,我已经拥有一个完全可用的捆绑包,有许多配置选项.捆绑包实际上是app/config.yml在其自己的部分配置的.我已经使用TreeBuilder实现了ConfigurationInterface,依此类推.我能够成功地在捆绑包中注入配置并在捆绑代码中使用它.
然而,我想做的事情非常简单,但即使我使用Composer发布和安装了一个完全可用的软件包,我已经使用Symfony 2只用了几个星期了,可能答案确实非常简单.但我不知道!
如何从我的app控制器访问捆绑配置?
例如......这就是配置app/config.yml(其中"设备"有数组原型):
my_bundle:
format: standard
devices:
main:
color: yellow
capacity: 200
Run Code Online (Sandbox Code Playgroud)
如何使用捆绑包从应用程序的控制器访问这些值?
我有一个我正在本地工作的宝石,由项目使用.
如果我在中指定了gem的位置path,我可以进行更改,项目会选择新的代码:
gem 'example', :path => "~/path/to/gems/example"
Run Code Online (Sandbox Code Playgroud)
但是,当我推送到Heroku时,捆绑失败,因为Heroku无法访问本地计算机上的gem源.
所以我可以将宝石源推送到远程仓库并将宝石源指向那里:
gem 'example', :github => 'example/example', :branch => 'example_feature'
Run Code Online (Sandbox Code Playgroud)
但是我现在需要将更改推送到此repo,然后更新gem以获取项目中的新变化:
$ cd ~/path/to/gems/example
$ git c -a -m "Update gem"
$ git push origin example_feature
$ cd ~/path/to/projects/project
$ gem update example
Run Code Online (Sandbox Code Playgroud)
通过为我的本地仓库设置本地覆盖,我可以减轻这种痛苦:
$ bundle config local.example ~/path/to/gems/example
Run Code Online (Sandbox Code Playgroud)
但我仍然需要将更改的文件添加到git,commit,然后$ gem update example每次我更改gem源,如果我想在我的项目中进行新的更改.
有没有办法让我的项目自动获取本地更改(就像我使用时一样path),但仍然在生产中使用远程仓库?
我不太确定这个错误消息是什么表明:
INFO: visiting unvisited references
INFO: visiting unvisited references
INFO: visiting unvisited references
INFO: visiting unvisited references
INFO: EJB5181:Portable JNDI names for EJB Hello: [java:global/SalutationApp/SalutationApp-ejb/Hello, java:global/SalutationApp/SalutationApp-ejb/Hello!ejb.Hello]
INFO: Loading application [SalutationApp#SalutationApp-war.war] at [SalutationApp-war]
INFO: SalutationApp was successfully deployed in 976 milliseconds.
WARNING: Context path from ServletContext: /SalutationApp-war differs from path from bundle: SalutationApp-war
INFO: myRemoteMethod..
Run Code Online (Sandbox Code Playgroud)
据我所知,似乎没有"application.xml"文件...已被弃用?
thufir@dur:~/NetBeansProjects/SalutationApp/dist$
thufir@dur:~/NetBeansProjects/SalutationApp/dist$ ll
total 16
drwxrwxr-x 2 thufir thufir 4096 Sep 9 01:42 ./
drwxrwxr-x 8 thufir thufir 4096 Sep 9 01:42 ../
-rw-rw-r-- 1 …Run Code Online (Sandbox Code Playgroud) Bundle无法安装better_errors.
Gem::InstallError: better_errors requires Ruby version >= 2.0.0.
An error occurred while installing better_errors (2.0.0), and Bundler cannot continue.
Make sure that `gem install better_errors -v '2.0.0'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)
但gem install better_errors工作正常.
ruby --version说ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux-gnu].我已经尝试升级到2.1但仍然无法正常工作.
有什么建议?
我想为特定方案添加一些捆绑项目.我可以创建一个运行脚本,但我无法读出当前的方案.
还有机会为Xcode 9.x中的特定方案添加一些捆绑文件吗?
当我gem install bundler在MacOS 10.13.x中使用命令时,错误是You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
$ gem install bundler
Fetching: bundler-1.16.2.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
Run Code Online (Sandbox Code Playgroud) 我正在使用JSF 2.我正在尝试动态解析托管bean属性的消息包引用.该值包含包名称和密钥.这是必需的,因为该值可能来自几个不同的包中的一个.我尝试了很多排列,但是bean的值似乎总是被解析为文字字符串(用EL括号输出),并且永远不会调用bundle来解析并返回值.有任何想法吗?
我试过了:
#{bundle['key']}
${bundle['key']}
bundle['key']
Run Code Online (Sandbox Code Playgroud)
它们完全按原样输出,也在一个<h:outputText>.如果我直接在页面中写它,它工作正常.我的理论是JSF没有意识到它必须将String作为表达式处理.有什么方法可以强迫它吗?
我有一个大问题.我创建了一个MVC 5项目,我无法使用默认代码启动它.问题在于捆绑.它在Global.asax.cs/Application_Start方法中停止BundleConfig.RegisterBundles(BundleTable.Bundles);.它说"找不到方法:'!! 0 [] System.Array.Empty()'." (system.missingMethodException而).
这是BundleConfig.cs代码(默认):
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
Run Code Online (Sandbox Code Playgroud)
我正在使用VS 2015 Preview.我该怎么做/改变?
谢谢!