草庐IT

OLD_VERSION_RUNNING

全部标签

ruby-on-rails - rake 数据库 :migrate is being aborted due to rake version difference

这个问题在这里已经有了答案:YouhavealreadyactivatedX,butyourGemfilerequiresY(11个答案)关闭8年前。我遇到了错误rakedb:migrate--tracerakeaborted!Youhavealreadyactivatedrake10.1.1,butyourGemfilerequiresrake10.1.0.Usingbundleexecmaysolvethis./Users/iang/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:

ruby-on-rails - rails - postgres 错误 : Reason: Incompatible library version: libpq. 5.dylib 需要 1.0.0 或更高版本,

我无法在我的Mac(10.6.8)上设置Ruby(1.9.3)、Rails和Postgres(9.0.8)。每次运行railsconsole时,我都会收到以下错误:/Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg.rb:4:in`require':dlopen(/Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg_ext.bundle,9):Librarynotloaded:@loader_path/../lib/libssl.dy

ruby-on-rails - rails : Why do I get "warning: already initialized constant JSON::VERSION" when running rake cucumber?

我刚刚设置了一个LinuxMintbox,用于使用rvm进行Rails开发。我继续生成了一个Rails5应用程序,设置了mysql连接,添加了cucumber-railsgem然后尝试运行:rakecucumber出于某种原因,我遇到了:/usr/bin/ruby2.3-Sbundleexeccucumber--profiledefault/usr/lib/ruby/vendor_ruby/json/version.rb:3:warning:alreadyinitializedconstantJSON::VERSION/var/lib/gems/2.3.0/gems/json-1.8.

ruby - Ruby gem 中 version.rb 的好处是什么

通常有一个version.rb文件,定义gem的版本,例如:moduleFooVERSION="0.0.1"end在.gemspec文件中,需要version.rb并在那里使用Foo::VERSION。这个约定有什么好处?--此外,有时使用命名空间时,生成的verison文件可能位于嵌套文件夹中。将version.rb直接放在lib/下并在那里指定版本不是更容易吗? 最佳答案 这样做是为了减少.gemspec文件的改动(更改率)。我认为依赖项更改比版本更新(也更频繁)重要得多。因此版本更改会增加太多噪音并隐藏重要的提交。

ruby-on-rails - 为什么要测试:units and test:functionals insist on running in development environment?

我正在尝试测试一些特定于环境的设置(特定于中间件,但这似乎无关紧要),但我无法让测试在正确的环境中运行。症状:如果我运行rubytest/unit/my_test.rb,一切都很好,因为它做的第一件事是需要test/test_helper.rb,这会设置环境"test"然后加载Rails环境。如果我运行raketest,第一批(功能)运行良好,但第二批(单元)失败。失败是ENV['RAILS_ENV]以某种方式在批处理之间未设置,然后config/environment.rb看到没有设置并使用默认值"development“。环境在config/environment.rb的开头和该文

ruby - RVM 不在雪豹 : 'Error running ' make ' 上安装 Ruby 1.9.2

当我尝试使用以下方法在SnowLeopard上安装Ruby1.9.2时:rvminstall1.9.2我得到以下信息:ERROR:Errorrunning'make',pleaseread/Users/mary/.rvm/log/ruby-1.9.2-p180/make.logERROR:Therehasbeenanerrorwhilerunningmake.Haltingtheinstallation.所以,我检查了make.log。它的结尾是这样的:readline.c:Infunction‘username_completion_proc_call’:readline.c:138

ruby - 如何检查 RUBY_VERSION 是否大于某个版本?

在我将RUBY_VERSION字符串拆分为句点并将位转换为整数等之前,是否有更简单的方法从Ruby程序检查当前RUBY_VERSION是否大于X.X.X? 最佳答案 Ruby的Gem库可以进行版本号比较:require'rubygems'#notneededwithRuby1.9+ver1=Gem::Version.new('1.8.7')#=>#ver2=Gem::Version.new('1.9.2')#=>#ver1ver2#=>-1参见http://rubydoc.info/stdlib/rubygems/1.9.2/Gem

ruby-on-rails - Rails 服务器错误 : Ruby version is 1. 8.7,但您的 Gemfile 指定了 1.9.3

我输入了一个现有的ruby​​应用程序,然后输入:$rails想在这里启动railsserver。但它说:您的Ruby版本是1.8.7,但您的Gemfile指定为1.9.3其实我有一个1.8.7,但是我把它删掉了。如果我这样做:$ruby-v它说:ruby1.9.3p286(2012-10-12修订版37165)[x86_64-darwin11.4.2]所以我不知道该如何解决。你能帮我个忙吗? 最佳答案 如果您使用rvm,运行这个:$rvmuse1.9.3 关于ruby-on-rails

ruby-on-rails - postgresql 数据库错误 : Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

当我运行rakedb:migrate或运行railss命令时,我得到同样的错误:Error:couldnotconnecttoserver:NosuchfileordirectoryIstheserverrunninglocallyandacceptingconnectionsonUnixdomainsocket"/var/run/postgresql/.s.PGSQL.5432"?当我尝试railss时,浏览器出现错误。这是我的database.ymldefault:&defaultadapter:postgresqlencoding:unicodepool:5development

ruby - 向 Ruby Thor CLI 添加 --version 选项

如何向我的Ruby添加--version选项Thor命令行界面应用程序。例如我希望能够运行$thor_app--version>thor_appversion1.0.0这个问题与RunaCLIThorappwithoutargumentsortaskname有关,但专门添加一个不需要任务的--version选项。注意这是在self-answerformat之后编写的.鼓励添加答案和更新 最佳答案 我在这种方法上运气不错:classCLI:__print_versiondesc"--version,-v","printtheversi