rbenv

Error Installing Atomic

别来无恙 提交于 2019-11-28 10:05:43
I'm trying to install gems to my new Ruby project using bundle install. I've set the version of Ruby using rbenv on my OS X 10.8.4 box. I get the following error: An error occurred while installing atomic (1.1.13), and Bundler cannot continue. Make sure that `gem install atomic -v '1.1.13'` succeeds before bundling. Kikime:jazzcatalog curt$ gem install atomic Building native extensions. This could take a while... Successfully installed atomic-1.1.13 1 gem installed Kikime:jazzcatalog curt$ rbenv rehash Kikime:jazzcatalog curt$ bundle install Fetching gem metadata from https://rubygems.org/....

Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0

╄→尐↘猪︶ㄣ 提交于 2019-11-28 05:29:12
问题 In my Gemfile I specified ruby version 2.0.0: ruby '2.0.0' But my console tells me I have 2.1.0dev: $ ruby -v ruby 2.1.0dev (2013-09-16 trunk 42951) [x86_64-darwin12.4.0] I am using rbenv and it tells my I don't have 2.1.0 installed, $ rbenv versions system * 2.0.0-dev Bundle update or bundle install says: "Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0" but using 'rbenv local 2.0.0-dev' leaves me with ruby 2.1.0dev again. Furthermore: $ rbenv global 2.0.0-dev $ cat ~/.bash

ruby script using rbenv in cron

落爺英雄遲暮 提交于 2019-11-27 19:20:06
I'm trying to run a ruby script using rbenv with cron. I know that I need to load rbenv in order to have the right ruby version loaded. I've tried options like this : */10 * * * * /bin/bash -c 'source $HOME/.bashrc; cd /data/app; ruby -v' >> /tmp/logfile.txt 2>&1 but as the session is not interactive, I'm not having the right ruby version. I've found example like this : 15 14 1 * * export BASH_ENV=/path/to/environment && /full/path/to/bash -c '/full/path/to/rvm_script.rb' It didn't work neighter. Then I wrote a loader, which only load rbenv in the current shell but it doesn't work. */1 * * * *

Bundler not working with rbenv, could not find [gem]

空扰寡人 提交于 2019-11-27 17:30:52
I've just made the switch from rvm to rbenv and I'm trying to use bundler for gem management. After running bundle install and trying to run a simple sinatra app ( ruby app.rb ), I get this: Could not find haml-3.1.4 in any of the sources Run `bundle install` to install missing gems. Running bundle install again had no effect. Also tried bundle update as suggested by another question response. This is my Gemfile: source "http://rubygems.org" gem "sinatra" gem "haml" This is what bundle show produces * bundler (1.0.22) * haml (3.1.4) * rack (1.4.1) * rack-protection (1.2.0) * sinatra (1.3.2) *

How do you use multiple rails versions with rbenv?

馋奶兔 提交于 2019-11-27 17:08:23
Is it possible to use multiple versions of rails using rbenv (e.g. 2.3 and 3.1)? This was easy with gemsets in rvm, but I'm wondering what the best way is to do it now that I've switched to rbenv (also, I'm looking for a way to do it without rbenv-gemset). not sure if you got an answer to this, but I thought I'd offer what I did and it seemed to work. So once you get rbenv installed, and you use it to install a specific ruby version, you can install multiple versions of rails to for that ruby. STEP 1. Install whatever version(s) of rails you want per ruby version % RBENV_VERSION=1.9.2-p290

How do RVM and rbenv actually work?

主宰稳场 提交于 2019-11-27 16:37:20
I am interested in how RVM and rbenv actually work. Obviously they swap between different versions of Ruby and gemsets, but how is this achieved? I had assumed they were simply updating symlinks, but having delved into the code (and I must admit my knowledge of Bash is superficial) they appear to be doing more than this. Short explanation: rbenv works by hooking into your environment's PATH . The concept is simple, but the devil is in the details; full scoop below. First, rbenv creates shims for all the commands ( ruby , irb , rake , gem and so on) across all your installed versions of Ruby.

rbenv irb history is not saving

点点圈 提交于 2019-11-27 15:59:33
问题 I install ruby via rbenv-installer. When I use irb console, I can use history by pressing up and down on keyboard. And when I exited from console and start it again, I can't use prewious history. When I press up-arrow-button, nothing was happened. When I used rvm this option was working. How can I switch on it in rbenv? 回答1: I found this way for solving my problem. In file ~/.irbrc write: require 'irb/ext/save-history' #History configuration IRB.conf[:SAVE_HISTORY] = 100 IRB.conf[:HISTORY

rbenv: Surviving without gemsets

大兔子大兔子 提交于 2019-11-27 09:58:22
问题 TL;DR Don't bother with gemsets; multiple versions of a gem may be installed concurrently. When necessary, specify which version to execute using $ gem-based-binary _version_ args notation. Use bundle exec when you have a Gemfile specifying the version. gem install rails -v 3.2.13 rails _3.2.13_ new Project2 cd Project2 bundle exec rails server UPDATE: 2015-06-04 I wrote this question three years ago. Partly, it was based on a false assumption, and partly the situation has changed since then.

Cannot execute “rails console” due to an error with readline

我的未来我决定 提交于 2019-11-27 09:48:48
问题 I cannot execute rails console due to this error: localhost:TwitterForZombies wiz$ rails c /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/irb/completion.rb:9:in `require': dlopen(/Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin12.2.1/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib (LoadError) Referenced from: /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin12.2.1/readline.bundle Reason: image not found -

Using $ sudo bundle exec … raises 'bundle: command not found' error

那年仲夏 提交于 2019-11-27 07:12:45
问题 I have installed rbenv on an Ubuntu sever. I can cd into my application directory and run $ bundle without issue, however I need to run $ sudo bundle exec ... and this gets me an error: bundle: command not found Why is this and how can I fix it? 回答1: Dan Carley's rbenv-sudo looks like it will do what you want: rbenv-sudo is a plugin for rbenv that allows you to run rbenv-provided Rubies and Gems from within a sudo session. A more detailed explanation of how it works is provided in this