每当Rails生成器运行一个或多个选项时,最薄的提升OptionParse::InvalidOption.
我使用的是Rails 3.1,Ruby 1.9.2-p290和Mintest 2.10.0.
generate命令实际上将运行并处理传递的选项,但Minitest会在最后引发异常和堆栈跟踪:
rails generate model x --no-migration -s -p
invoke active_record
identical app/models/x.rb
invoke test_unit
identical test/unit/x_test.rb
identical test/fixtures/xs.yml
/Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:900:in 'block in process_args': invalid option: --no-migration (OptionParser::InvalidOption)
from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:879:in 'new'
from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:879:in 'process_args'
from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:929:in '_run'
from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:922:in 'run'
from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:690:in 'block in autorun'
Run Code Online (Sandbox Code Playgroud)
还有其他人遇到过这个吗?
我正在尝试将我的应用程序推送到Heroku,但是我得到了这个相当随意的错误:
Errno::ENOENT: No such file or directory @ rb_sysopen -\
/tmp/build_.../config/aws.yml
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:39:in `initialize'
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:39:in `open'
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:39:in `unsafe_load_file'
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:24:in `load_file_with_options'
/tmp/build_.../config/initializers/aws.rb:1:in `<top (required)>'
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `load'
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `block in load'
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
/tmp/build_.../vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in `load'
/tmp/build_.../vendor/
Run Code Online (Sandbox Code Playgroud)
我在aws.yml文件中有正确的键,所以我不确定为什么我会收到此错误,也可以在本地正常工作.我已经尝试删除该/tmp文件夹并让Heroku重新生成它也无法正常工作.我该如何解决?
在Ubuntu 14.04上使用Capistrano部署Rails应用程序时,我收到以下错误:
fatal: destination path '/var/www/APP-NAME/repo' already exists and is not an empty directory.
cf5a389e] Running /usr/bin/env [ -f /var/www/rd/repo/HEAD ] on LINODE-INSTANCE-IP
DEBUG[cf5a389e] Command: [ -f /var/www/rd/repo/HEAD ]
DEBUG[cf5a389e] Finished in 0.005 seconds with exit status 1 (failed).
DEBUG[8899b95c] Running /usr/bin/env if test ! -d /var/www/rd; then echo "Directory does not exist '/var/www/rd'" 1>&2; false; fi on LINODE-INSTANCE-IP
DEBUG[8899b95c] Command: if test ! -d /var/www/rd; then echo "Directory does not exist '/var/www/rd'" 1>&2; false; fi
DEBUG[8899b95c] Finished in 0.005 …Run Code Online (Sandbox Code Playgroud) 我可以jruby-complete从传递给它的jar中消耗宝石.但我想使用一个中央宝石回购.
这就是我现在能做的:
$ java -jar jruby-complete-1.6.5.jar -S gem list
*** LOCAL GEMS ***
rake (0.8.7)
sources (0.0.1)
$ java -jar jruby-complete-1.6.5.jar -rjar_of_gems.jar -S gem list
*** LOCAL GEMS ***
erubis (2.7.0)
mizuno (0.4.1)
rack (1.4.0)
rack-protection (1.2.0)
rake (0.8.7)
rna (0.0.101)
sinatra (1.3.2)
sources (0.0.1)
tilt (1.3.3)
Run Code Online (Sandbox Code Playgroud)
每次更新gem或者需要添加gem时都必须更改jar文件比我想做的更开销.
任何建议,必须有一种方法jruby-complete来指向像常规jruby宝石回购?
我已经安装或者我认为是在运行leopard 10.5.8的osx ppc上是如此新版本的ruby但是当我运行时ruby --version it shows the old one 1.8.7(默认在机器上)但是当我运行时...
find /usr -type f -name \*.rb
Run Code Online (Sandbox Code Playgroud)
它显示ruby2.0.o打开:
/usr/local/lib/ruby/2.0.0/
Run Code Online (Sandbox Code Playgroud)
包含所有.rb文件.
但是当我检查使用时 locate ruby
它显示了1.8.7版本
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Run Code Online (Sandbox Code Playgroud)
任何时候我检查ruby --version它显示1.8.7 ...我怎么能改变它?
完全是新手......谢谢.
BTW rvm不是通过anychance或自制软件安装的,我的xcode没有下载.
我正在使用letrate gem并收到以下错误:
ArgumentError - wrong number of arguments (3 for 2):
lib/letsrate/lib/letsrate/model.rb:69:in `letsrate_rateable'
app/models/model_definition.rb:3:in `<class:ModelDefinition>'
app/models/model_definition.rb:1:in `<top (required)>'
Run Code Online (Sandbox Code Playgroud)
我试图将版本降级1.0.9为1.0.8,然后我将源复制到lib目录仍然我得到相同的错误.
我正在运行Spree 2.2.我正在尝试将标准分类法/过滤器列表显示在Spree的每个单独的产品页面上,但我找不到它在哪里决定是否要显示侧边栏内容.如果有人能够阐明决定在哪里/如何决定我会非常感激.
我正在尝试复制pyLearn2文档中的教程示例.当我运行时python make_dataset.py,在示例中,我收到此错误:
11:17 $ python make_dataset.py
/Users/user/pylearn2/pylearn2/utils/image.py:16: UserWarning: Unable to import matplotlib. Some features unavailable. Original exception: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/backends/_macosx.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Run Code Online (Sandbox Code Playgroud)
参考自:/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
期望: /usr/local/lib/libjpeg.8.dylib
我可以matplotlib在命令行中导入和映像python.有人可以帮助我理解它抱怨什么以及如何解决错误?
另一个问题(可能与上述问题有关,也可能与之无关)是链接错误
使用以下命令行编译期间出现问题:
g++ -dynamiclib -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=core-avx-i -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave …Run Code Online (Sandbox Code Playgroud)我mongo_mapper在Rails中使用MongoDB和gem,项目足够大.有什么办法可以将数据从Mongoid迁移到Postgresql吗?
ruby ×3
gem ×2
rvm ×2
capistrano ×1
capistrano3 ×1
gsub ×1
heroku ×1
jruby ×1
macos ×1
matplotlib ×1
minitest ×1
mongodb ×1
mongomapper ×1
osx-leopard ×1
postgresql ×1
python ×1
rating ×1
ruby-2.0 ×1
rubygems ×1
spree ×1
theano ×1