这个让我疯了.我可以通过irb加载一个gem:
steve@server:/var/www/listings$ irb
irb(main):001:0> Gem.path
=> ["/home/steve/.gem/ruby/1.9.1", "/usr/local/ruby/lib/ruby/gems/1.9.1"]
irb(main):002:0> require 'nokogiri'
=> true
Run Code Online (Sandbox Code Playgroud)
但我无法通过rails控制台加载它:
irb(main):001:0> Gem.path
=> ["/home/steve/.gem/ruby/1.9.1", "/usr/local/ruby/lib/ruby/gems/1.9.1"]
irb(main):002:0> require 'nokogiri'
=> false
Run Code Online (Sandbox Code Playgroud)
宝石(nokogiri)已安装
steve@server:/var/www/listings$ gem which nokogiri
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.3.1/lib/nokogiri.rb
Run Code Online (Sandbox Code Playgroud)
捆绑同意
steve@server:/var/www/listings$ bundle show nokogiri
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.3.1
Run Code Online (Sandbox Code Playgroud)
但是,当然,rake spec失败了
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:304:in `rescue in depend_on': No such file to load -- Nokogiri (LoadError)
Run Code Online (Sandbox Code Playgroud)
其他环境信息:
steve@server:/var/www/listings$ ruby --version
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
steve@server:/var/www/listings$ rails --version
Rails 3.0.1
steve@server:/var/www/listings$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel …Run Code Online (Sandbox Code Playgroud) 如果我运行bundle install,应用程序通过,一切都已正确安装.
但是,如果我重新启动nginx并访问该网站,我会看到Passenger Error消息.
Ruby (Rack) application could not be started
Error message:
http://github.com/railsdog/spree.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Exception class:
PhusionPassenger::UnknownError
Application root:
/home/shadyfront/webapps/age_of_revolt/releases/20110214205657
Run Code Online (Sandbox Code Playgroud)
我也发现了这个:
如果我做一个捆绑显示狂欢,它返回:
/home/shadyfront/webapps/rails/gems/bundler/gems/spree-594cd0f5a53c
Run Code Online (Sandbox Code Playgroud)
但任何其他宝石都在这里:
/home/shadyfront/webapps/rails/gems/gems/ what does that mean?
Run Code Online (Sandbox Code Playgroud)
谁知道为什么会这样?
的Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'spree', '0.5.99', :git => 'http://github.com/spree/spree.git'
gem 'haml'
gem 'ruby-debug'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'ckeditor', '3.4.2.pre'
# aged_revolt gem is a local gem that is generated with Spree extensions …Run Code Online (Sandbox Code Playgroud) 在阅读了介绍性的Android编程书之后,我想改变示例应用程序,以巩固我对一些未真正涵盖的主题的理解.在进行更改时,我犯了一个错误,但我很好奇为什么错误在某些情况下有效但在其他情况下却没有.
应用程序中的一个活动在a中存储一系列问题Hashtable<Integer, Question>,其中Question是一个包含int和两个字符串的小类.最初编写时,活动会从服务器上下载每个问题onCreate(),因此我希望实施onSaveInstanceState()以防止一些冗余下载. onSaveInstanceState()使用将Hashtable保存到Bundle中putSerializable().
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
// mQuestions is a member variable of
// type Hashtable<Integer, Question>
if (mQuestions != null && mQuestions.size() > 0) {
outState.putSerializable(SAVED_QUESTIONS, mQuestions);
}
}
Run Code Online (Sandbox Code Playgroud)
即使在我知道Parcelable是什么或如何实现之前,它也能完美地适应屏幕方向的变化.我只知道当我按下模拟器的主页键和应用程序静默时出现问题,无法在没有LogCat输出的情况下崩溃.堆栈跟踪让我查找Parcelable并使Question实现它.
我的问题不是我做错了什么.问题是:当Question类没有实现Parcelable时,为什么应用程序只在按Home而不是屏幕方向更改时崩溃?
android bundle parcelable activity-lifecycle android-activity
我正在为我的应用程序添加iCloud支持,但我注意到在iCloud - >管理存储设置中,我的应用程序的图标丢失了.我已经在"Resources"文件夹的xcode项目中添加了Icon-Small.png/Icon-Small-50.png加上他们的@ 2x版本,然后在Info.plist中添加了他们的名字,但它仍然显示为白色.
我究竟做错了什么?
我无法运行post-receive hook,如下所示:
#!/bin/sh
unset $(git rev-parse --local-env-vars)
cd ~/commodity
git pull origin master
bundle install
bundle exec rake assets:precompile
thin restart
Run Code Online (Sandbox Code Playgroud)
我正在从本地推送到远程,我收到此错误:
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 319 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: From /var/www/html/test
remote: * branch master -> FETCH_HEAD
remote: Updating a06129c..c3c3da3
remote: hooks/post-receive: line 19: bundle: command not found
remote: hooks/post-receive: line 20: bundle: command not …Run Code Online (Sandbox Code Playgroud) 我一直试图开始研究OSGI几天来安静.我已经尝试了许多教程来处理eclipse,特别是从apache felix或Equinox开始,但是一步一步的教程从来没有带我到最后创建一个捆绑.
我甚至没有运气就尝试过控制台命令.OSGI过时了吗?联盟网站上的所有教程都非常陈旧,我无法追随它们.我也在这里尝试了BndTools Totorial ,但是当我达到4.3时,它无法解析"@Component"所以我就在那里停止了.在关注Osgi Book Preview时,我也找不到"Make Bundle",所以我再次停下来.我真的很沮丧.难道没有办法让初学者进入OSGI吗?
更新:
对于有兴趣开始使用OSGI的其他人,我发现Osgi in Action这本书非常有用,也是初学者的好指南.
这是错误日志,当我使用bundle install.
我想在Github上搭建一个博客,所以使用Octopress,但是没有成功。如果您有其他方法,请告诉我,谢谢。
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for main() in -lc... yes
creating Makefile
make "DESTDIR="
make: *** No rule to make target `"/Applications/Xcode', needed by `redcloth_attributes.o'. Stop.
Gem files will remain installed in /var/folders/zb/bxbkz6pd5fscs29zq2hk1b4h0000gn/T/bundler20141230-81071-q2p8fv/RedCloth-4.2.9/gems/RedCloth-4.2.9 for inspection.
Results logged to /var/folders/zb/bxbkz6pd5fscs29zq2hk1b4h0000gn/T/bundler20141230-81071-q2p8fv/RedCloth-4.2.9/gems/RedCloth-4.2.9/ext/redcloth_scan/gem_make.out
An error occurred while installing RedCloth (4.2.9), and Bundler cannot
continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud) 我在bundle install使用Ubuntu 14.04 时面临以下错误DigitalOcean
Fetching source index from https://rubygems.org/
Fetching git://github.com/activeadmin/activeadmin.git
Retrying git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet due to error (2/3): Errno::ENOMEM Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet
Retrying git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet due to error (3/3): Errno::ENOMEM Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/sachin/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.12/lib/bundler/source/git/git_proxy.rb:114:in ``': Cannot …Run Code Online (Sandbox Code Playgroud) 我目前正在将我的Angular 2应用程序与WebPack捆绑在一起.我们仍在进行快速循环,因此我们希望包含很少变化的Angular 2 UMD CDN准备捆绑包,而不是为我们的构建和应用程序加载过程添加延迟,例如:
<script src="https://npmcdn.com/@angular/core@2.0.0-rc.3/bundles/core.umd.min.js"></script>
<script src="https://npmcdn.com/@angular/common@2.0.0-rc.3/bundles/common.umd.min.js"></script>
<script src="https://npmcdn.com/@angular/compiler@2.0.0-rc.3/bundles/compiler.umd.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
plugins: [ new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js") ],我的应用程序包很小,但我手动构建一个单独的,唯一的1MB包,其中包含大部分Angular 2框架,每个版本.此文件根据我的应用程序稍微改变每个版本,并且在我的应用程序或各种应用程序的版本之间不可移植,并且没有"CDN"的好处.当然,我必须包含此文件才能运行我的应用程序.@angular|rxjs,例如plugins: [ new webpack.IgnorePlugin(/\@angular|rxjs/) ],它会排除供应商文件,但会在应用程序包的顶部插入硬编码异常/抛出错误.externals: ['@angular/core', ...,我function(module, exports) { module.exports = @angular/core; },在我的应用程序包中输出,这显然不起作用.WebPack文档并不是非常明确,但我想我可以指定一个libraryTarget或引用的resolve函数,它将指示WebPack在模块加载中进行编译.System.register()调用我所期望的NPM命名空间,例如System.register("myapp/boot", ['@angular/core', ...,但我仍在使用SystemJS配置调用UMD的.另外,相对于WebPack生成的文件,此文件的大小为25%.如何构建不依赖于唯一重新打包的Angular 2包的应用程序包?
我目前正在建立对抗RC3.我的进程目前是WebPack,如上所述,但我会转移到另一个工具集,如果这使它更容易.
做了一些研究,我想我被WebPack的"Loader"术语误导了.我必须使用模块加载器,它看起来不像WebPack有一个适用于此的工具.
要分配UMD包模块名称空间(以及连接依赖项),不能在脚本标记中加载它们.相反,它们必须使用给定的this上下文进行评估,以充当模块引用.这意味着即使我希望它们全部同步加载,我仍然需要配置其他类似SystemJS的东西来加载它们,因此它们的上下文被控制/包装.
这个Angular 2 plunker接近我正在寻找的东西.它使用Angular …
我正在尝试进行的测试项目依赖于unf_ext所安装的0.0.7.4 gem,因此我遇到了麻烦。
如果我跑步,bundle install我会得到:
<some packages>
Using unf_ext 0.0.7.4
<some package>
Bundle complete! 6 Gemfile dependencies, 27 gems now installed.
Run Code Online (Sandbox Code Playgroud)
但是如果我这样做,bundle info unf_ext我会得到:
Resolving dependencies...
Could not find unf_ext-0.0.7.4 in any of the sources
Run Code Online (Sandbox Code Playgroud)
如果我尝试gem install unf_ext我会得到
无法创建makefile
当我打开mkmf.log文件时说:
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4: int main(int argc, char **argv)
5: {
6: return 0;
7: }
/* end */
Run Code Online (Sandbox Code Playgroud)
如果我跑步,sudo …