我在生产服务器上从RVM移动到rbenv.我使用"rvm implode"卸载了rvm并安装了rbenv,ruby 1.9.2,rails,passenger和nginx-module.除了更改passenger_root之外,我没有修改我的originlal nginx.conf,如下所示:
1st Try:
passenger_root /root/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/passenger-3.0.9;
passenger_ruby /root/.rbenv/versions/1.9.2-p290/bin/ruby;
2nd Try:
passenger_root /root/.rbenv/shims/passenger;
passenger_ruby /root/.rbenv/shims/ruby;
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试运行我的应用程序时,我在error.log中看到以下错误:
[error] 1291#0: *105 open() "/home/passenger/grabber/current/public/view" failed (2: No such file or directory)
Run Code Online (Sandbox Code Playgroud)
这清楚地表明乘客没有启动,我的rails应用程序无法识别.当我尝试手动启动乘客时,我收到以下错误:
[ pid=17605 thr=70022120 file=utils.rb:176 time=2011-10-23 23:40:41.917 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (libruby.so.1.9: cannot open shared object file: No such file or directory - /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/nokogiri.so) (process 17605, thread #<Thread:0x858e7d0>):
from /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
Run Code Online (Sandbox Code Playgroud)
我已经多次安装了nokogiri,我可以在我的宝石列表中看到nokogiri.我不确定为什么搬到rbenv已经打破了我的乘客.
当我启动tmux时,tmux自动设置RBENV_VERSION ...
谁知道如何阻止它?
因为它自动设置它,我需要做
$ export RBENV_VERSION
取消它并制作.ruby-version工作.谢谢.
所以我尝试在我运行在VirtualBox上的新ubuntu 12.04LTS上通过rbenv安装ruby.
我从rbenv https://github.com/sstephenson/rbenv和红宝石打造https://github.com/sstephenson/ruby-build.
然后我运行以下但构建失败:(
rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20130506102349.2564
Results logged to /tmp/ruby-build.20130506102349.2564.log
Last 10 log lines:
installing default gems: /home/shivin/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
bigdecimal 1.2.0
io-console 0.4.2
json 1.7.7
minitest 4.3.2
psych 2.0.0
rake 0.9.6
rdoc 4.0.0
test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.如果您需要更多详细信息,请与我们联系.谢谢!
当我输入which ruby它总是返回ruby: aliased to bundled_ruby
当我尝试which bundled_ruby它返回:
bundled_ruby () {
_run-with-bundler ruby $@
}
Run Code Online (Sandbox Code Playgroud)
然后我尝试which _run-with-bundler它返回:
_run-with-bundler () {
if _bundler-installed && _within-bundled-project
then
bundle exec $@
else
$@
fi
}
Run Code Online (Sandbox Code Playgroud)
这一切是从哪里来的,我如何which ruby重新开始工作?
我正在使用OSX(v10.8.2),brew,rbenv,ruby-build,zsh
多年来我一直使用RVM作为我的Ruby版本管理器,但我想切换到rbenv以简化它.但是我发现部署有些奇怪的问题.这里似乎出错了:
# env RBENV_ROOT=\"/home/deploy/.rbenv\" PATH=\"/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH\" /home/deploy/.rbenv/bin/rbenv exec bundle install --gemfile /domains/myapp.com/releases/20140119013611/Gemfile --path /domains/myapp.com/shared/bundle --deployment --without development test
> rbenv: bundle: command not found
> The `bundle' command exists in these Ruby versions:
> 2.0.0-p353
Run Code Online (Sandbox Code Playgroud)
好的,所以我指定了我想要的rbenv版本 -
# env RBENV_ROOT=\"/home/deploy/.rbenv\" PATH=\"/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH\" RBENV_VERSION=\"2.0.0-p353\" /home/deploy/.rbenv/bin/rbenv exec bundle install --gemfile /domains/myapp.com/releases/20140119013611/Gemfile --path /domains/myapp.com/shared/bundle --deployment --without development test
> rbenv: version `"2.0.0-p353"' is not installed
Run Code Online (Sandbox Code Playgroud)
呵呵.那真是怪了.
# rbenv versions
> system
> * 2.0.0-p353 (set by /home/deploy/.rbenv/version)
Run Code Online (Sandbox Code Playgroud)
知道我哪里错了吗?该bundle install命令似乎认为2.0.0-p353不存在,但rbenv versions …
因此,正如标题所暗示的那样,我正在尝试安装ruby 2.1.2,尽管我已经尝试安装其他版本,但我得到了同样的错误.我正在运行OSX 10.9.2.
我试过了:
通过安装新的gcc编译器 brew install gcc47
安装更新的OSX命令行工具
卸载rbenv并再次尝试
重启机器
这是我得到的总和:
rbenv install 2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb4 25589e6635
Installing ruby-2.1.2...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728
Results logged to /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728.log
Last 10 log lines:
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
compiling miniinit.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
dtrace: failed to compile script probes.d: Preprocessor not found
make: *** [probes.h] Error 1
make: *** Waiting for unfinished …Run Code Online (Sandbox Code Playgroud) 有一些答案说使用gem 'cocoapods', '0.33.1'或gem 'pod', '0.33.1
但这不起作用.
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command cocoapods,
在一个项目中,我需要使用0.33.1,而在另一个项目中使用0.34.4.如何在命令行上快速切换cocoapods版本?我不想使用gem install或uninstall.
我使用rbenv与ruby版本2.0.0p0.继续使用rbenv是首选,但只有在没有其他选项时我才能切换到rvm或纯ruby.
谢谢.
我读到“ rbenv 无法更改全局 ruby 版本”,我需要将其添加~/.rbenv/bin到我的 PATH 中才能使 rbenv 工作。
文档中也提到了它,但该目录不存在,如下所示:
? ~ ls -a ~/.rbenv/
. .. plugins shims version versions
Run Code Online (Sandbox Code Playgroud)
那么为什么我需要在我的路径中添加一个不存在的目录rbenv才能工作呢?
编辑:
@theTinMan,我尝试卸载并重新安装,但我仍然没有 ~/.rbenv/bin 路径。您在文档中的何处看到它应该在那里?
? ~/D/w/t/underline-test rbenv --version
rbenv 1.0.0
? ~/D/w/t/underline-test which rbenv
rbenv () {
local command
command="$1"
if [ "$#" -gt 0 ]
then
shift
fi
case "$command" in
(rehash | shell) eval "$(rbenv "sh-$command" "$@")" ;;
(*) command rbenv "$command" "$@" ;;
esac
}
? ~/D/w/t/underline-test cd
? …Run Code Online (Sandbox Code Playgroud) noob在这里,我正在尝试安装octopress但是当我运行时rbenv exec bundle install我得到了这个错误.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
/home/idiot/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20170227-4161-uizrqn.rb extconf.rb
creating Makefile
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR=" clean
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR="
compiling yajl.c
compiling yajl_alloc.c
compiling yajl_buf.c
compiling yajl_encode.c
compiling yajl_ext.c
yajl_ext.c: In function ‘rb_yajl_parser_parse’:
yajl_ext.c:471:17: warning: variable ‘stat’ set but not used [Wunused-but-set-variable]
yajl_status stat;
^~~~
yajl_ext.c: In function ‘rb_yajl_encoder_enable_json_gem_ext’:
yajl_ext.c:881:22: error: ‘rb_cFixnum’ undeclared (first use in this function)
rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1);
^~~~~~~~~~
yajl_ext.c:881:22: note: …Run Code Online (Sandbox Code Playgroud) 升级到 Big Sur 后,我在运行我的 Ruby 服务器时出现错误,通过不同的文件轮换
cannot load such file --
Run Code Online (Sandbox Code Playgroud)
或者
Interrupted system call --
Run Code Online (Sandbox Code Playgroud)
每次运行 bundle exec rackup 时,这些错误都会轮换各种文件。我尝试过卸载/重新安装 RVM、XCode 命令行工具,甚至尝试切换到 rbenv。结果一样。
有任何想法吗?