Tag: rvm

ruby Date.today和DateTime.now的错误日期

我用RVM安装了ruby-1.8.6-p383。 系统ruby是1.9.1_p378-1 使用ruby 1.8时,我从Date.today和DateTime.now得到错误的日期。而Time.now是正确的: irb(main):002:0> DateTime.now.to_s => “2126–1-10618T11:23:43+00:00” irb(main):004:0> Date.today.to_s => “2126–1-10618” irb(main):005:0> Time.now => Thu Jan 28 11:55:27 +0000 2010 如果我切换到ruby 1.9,一切都很好: irb(main):003:0> DateTime.now.to_s => “2010-01-28T11:58:51+00:00” irb(main):004:0> Date.today.to_s => “2010-01-28” irb(main):005:0> Time.now => 2010-01-28 11:59:05 +0000 有关如何让DateTime在ruby 1.8中正常工作的任何建议都将非常感激!

库没有加载错误 – 错误的ruby

我正在使用RVM和Ruby 1.9.3 p448,但是当我尝试运行我的rails服务器时,我收到此错误(加上其他一些东西) 9): Library not loaded: /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p327/lib/libruby.1.9.1.dylib (LoadError) Referenced from: /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/posix-spawn-0.3.6/lib/posix_spawn_ext.bundle Reason: image not found – /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/posix-spawn-0.3.6/lib/posix_spawn_ext.bundle 奇怪的是,它引用了ruby-1.9.3-p327,这甚至都不是我的RVM安装之一。 我应该删除那个Ruby文件夹吗?它没有找到libruby? 或者还有什么可能是错的? 编辑 – 完全错误 /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require’: dlopen(/Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/posix-spawn-0.3.6/lib/posix_spawn_ext.bundle, 9): Library not loaded: /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p327/lib/libruby.1.9.1.dylib (LoadError) Referenced from: /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/posix-spawn-0.3.6/lib/posix_spawn_ext.bundle Reason: image not found – /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/posix-spawn-0.3.6/lib/posix_spawn_ext.bundle from /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require’ from /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency’ from /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require’ from /Users/sashafklein/rails//vendor/bundle/ruby/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:2:in […]

如何在使用RVM时跨所有gemset安装gem

有没有办法在使用RVM时在系统中的所有rubies和gemsets(不仅仅是默认或系统ruby)上安装gem?

运行“捆绑安装”失败并要求我运行“捆绑安装”

事实上,当从我从git repo克隆的现有rails应用程序内部运行时,所有与gem相关的命令都会产生相同的错误消息。 $ bundle install Could not find tzinfo-0.3.27 in any of the sources Run `bundle install` to install missing gems. $ gem list Could not find tzinfo-0.3.27 in any of the sources Run `bundle install` to install missing gems. $ bundle update Could not find tzinfo-0.3.27 in any of the sources Run `bundle install` […]

头部使用未知选项-1 / -n错误。 可能与ruby有关

在OSX 10.9.1中启动终端时,我遇到了一个反复出现的问题。 每次我启动终端时,我都会重复以下至少30次 Unknown option: 1 Usage: head [-options] … -m use method for the request (default is ‘HEAD’) -f make request even if head believes method is illegal -b Use the specified URL as base -t Set timeout value -i Set the If-Modified-Since header on the request -c use this content-type for POST, PUT, […]

RVM安装问题 – 无法执行端口(autoconf)

我正在尝试在OSX山狮上安装Jekyll。 首先,我想安装RVM,然后安装最新的ruby。 但是,RVM安装失败,我无法解决问题。 任何帮助赞赏 这是我做的: 已安装的OSX命令行工具 试图安装RVM( \curl -L https://get.rvm.io | bash -s stable –ruby )但是它在日志中出错而失败“错误:请安装Xcode和/或运行xcode-select to指定它的位置。“ 安装XCode,看看是否有帮助(现在实现我可以使用xcode-select哦) 尝试再次安装RVM但再次失败,请参阅下面的错误 最后一行安装输出包括错误: 安装所需的软件包:autoconf,automake,libtool,pkgconfig,apple-gcc42,libiconv,libyaml,libffi,readline,libxml2,libxslt,libksba,openssl,curl-ca-bundle,sqlite3,zlib,gdbm,ncurses …… 错误运行 ‘requirements_osx_port_libs_install的automake的autoconf libtool的pkgconfig苹果gcc42 libiconv的libyaml libffi的readline的libxml2的libxslt libksba OpenSSL的curl-CA-束sqlite3的zlib的GDBM ncurses的’,请阅读/Users/xxx/.rvm/log/1371125385_package_install_autoconf_automake_libtool_pkgconfig_apple-gcc42_libiconv_libyaml_libffi_readline_libxml2_libxslt_libksba_openssl_curl-ca-bundle_sqlite3_zlib_gdbm_ncurses。日志 我打开了错误日志,它说明: 错误:无法执行端口:无法打开文件:/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/autoconf/Portfile 对于其他人来说这可能是显而易见的,但坦率地说,我不确定我应该做些什么来解决它!

RVM安装缺少$ PATH

当我尝试重新安装最新版本的RVM时,RVM向我提供了与缺少或不正确的“$ PATH”变量相关的错误通知。 有谁知道(a)这个变量应该设置为什么,以及(b)如何改变它? 我搜索了几十个主题,但似乎没有人完全引用这个问题。 任何帮助将不胜感激。 谢谢,科迪 Codys-MacBook-Pro:demo_app Cody$ rvm get head && rvm reload ######################################################################## 100.0% Downloading RVM from wayneeseguin branch master Upgrading the RVM installation in /Users/Cody/.rvm/ RVM PATH line found in /Users/Cody/.bashrc /Users/Cody/.zshrc. RVM sourcing line found in /Users/Cody/.bash_profile /Users/Cody/.zprofile. Upgrade Notes: /Users/Cody/.bash_profile:3:export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/Cody/.rvm/bin * WARNING: Above files contains `PATH=` with no `$PATH` […]

RVM查找系统gems的可执行文件

我已经安装了RVM以及ruby版本。 但是,如果我启动控制台并运行命令rails服务器,捆绑安装等,我收到此错误 bash: /usr/bin/rails: /usr/bin/ruby1.8: bad interpreter: No such file or directory 但如果我先运行rvm use 1.9.2 ,那么一切都还可以。 我尝试使用`rvm use –default 1.9.2’,但没有改变。 这是否意味着它使用与RVM中不同的ruby? 提前致谢!

我在Mac OS X上遇到“RVM不是函数”错误,并且没有发布的解决方案

我在Mac OS x 10.8.2(“Mountain Lion”)上,我成功安装了RVM 1.17.8及其依赖项。 我可以使用它来安装使用rvm install 1.9.2 Ruby版本,但我无法在不收到此错误的情况下执行rvm use : RVM is not a function, selecting rubies with ‘rvm use …’ will not work. You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use `/bin/bash –login` as the command. Please visit https://rvm.io/integration/gnome-terminal/ for a example. […]

在Yosemite中安装Ruby时出错

我最近将我的OS X更新到10.10,然后面临通过RVM安装ruby的问题。 gcc46存在依赖性,我无法解决。 任何帮助表示赞赏。 下面是错误堆栈。 rvm reinstall ruby-1.9.3-p547 ruby-1.9.3-p547 – #removing src/ruby-1.9.3-p547 – please wait ruby-1.9.3-p547 – #removing rubies/ruby-1.9.3-p547 – please wait Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.10/x86_64/ruby-1.9.3-p547. Continuing with compilation. Please read ‘rvm help mount’ to get more information on binary rubies. Checking requirements for […]