I'm a newbie to Ruby. Trying to setup nanoc in my machine. I'm running Ubuntu 14.04.
After the nanoc installation, when I type
$nanoc --version
I get the following errors:
/home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler/shared_helpers.rb:24:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:248:in `default_gemfile'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:192:in `root'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:99:in `bundle_path'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:400:in `configure_gem_home_and_path'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:90:in `configure'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:151:in `definition'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:116:in `setup'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /home/ananth/.rvm/gems/ruby-head/gems/nanoc-3.7.0/bin/nanoc:7:in `<top (required)>'
from /home/ananth/.rvm/gems/ruby-head/bin/nanoc:23:in `load'
from /home/ananth/.rvm/gems/ruby-head/bin/nanoc:23:in `<main>'
from /home/ananth/.rvm/gems/ruby-head/bin/ruby_executable_hooks:15:in `eval'
from /home/ananth/.rvm/gems/ruby-head/bin/ruby_executable_hooks:15:in `<main>'
Am I missing something from my rvm? Anything to do with $PATH, .bashrc or .bash_profile?
Thanks for the help in advance!
This is a bug in 3.7.0 that will be fixed in 3.7.1.
3.7.0 unintentionally requires a Gemfile to be present when Bundler is installed.
To avoid this bug, either temporarily switch back to 3.6.11, or use a Gemfile (I recommend the latter).
Related
i'm using a ubuntu vagrant box with installed capistrano to develop an application.
when i tried to deploy i get the following error:
/usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:152:in `require': no such file to load -- capistrano/ext/multistage (LoadError)
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:152:in `require'
from ./config/deploy.rb:3:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from Capfile:4:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `load_recipes'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `load_recipes'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:31:in `execute!'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:14:in `execute'
from /usr/bin/cap:4
as google suggested i tried to reinstall capistrano, but this failed because of dependencies(net-ssh requires ruby >= 2.0)
so i installed net-ssh v2.9.2
sudo gem install net-ssh -v 2.9.2
Fetching: net-ssh-2.9.2.gem (100%)
Successfully installed net-ssh-2.9.2
1 gem installed
but now the next dependency error occures...
How do i make a fresh installation of capistrano working?
do i need a newer version of ruby(apt-get install ruby tells me that the newest version is already installed)?
Or is the cause of this error something complete different?
I can't see anything in your trace about what version of ruby you're on, but you did say "net-ssh requires ruby >= 2.0", so you might need a newer version of ruby like you said. You can check the version of ruby you're using with ruby -v. I would also recommend using a version manager so that you can use multiple versions between projects. I find RVM or rbenv to be good starting points.
OK, this is strange...
after running vagrant provision multiple(~5) times and installing/deinstalling multiple gems and ruby versions the next "vagrant provision" fixed the problem magicaly. i still dont know why this error occured and what fixed it, bull i'll close this question...
I have a Rails server application that uses the openid_connect gem. When I attempt to run it on CentOS 6.6, I get:
uninitialized constant OpenSSL::PKey::EC
Here is the full stacktrace:
$ rails server
/home/foo/.rvm/gems/ruby-2.1.3/gems/json-jwt-1.5.1/lib/json/jwk/jwkizable.rb:69:in `<top (required)>': uninitialized constant OpenSSL::PKey::EC (NameError)
from /home/foo/.rvm/gems/ruby-2.1.3/gems/json-jwt-1.5.1/lib/json/jwt.rb:102:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object/id_token.rb:1:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object.rb:7:in `block in <top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object.rb:6:in `each'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object.rb:6:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/connect_object.rb:52:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect.rb:85:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /home/foo/tmp/openid_connect_sample/config/application.rb:7:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:53:in `require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:50:in `tap'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
What does this mean and how I can I get past it?
This problem stems from Red Hat's refusal to include (for fear-of-patent-litigation reasons) certain Elliptic Curve (EC) algorithms in CentOS' default build of OpenSSL.
Note: According to #Cal's answer, CentOS 6.7 does not have this issue.
The openid_connect gem is dependent on the json-jwt gem, which uses one of those not-included algorithms.
Therefore, you need to rebuild a new version of OpenSSL that includes the needed algorithms.
These are the steps I followed (adapted from here) to build a new OpenSSL on my machine:
cd /usr/src
wget https://www.openssl.org/source/openssl-1.0.1l.tar.gz
yum install autoconf automake (you probably already have these installed)
tar zxvf openssl-1.0.1l.tar.gz
cd openssl-1.0.1l
export CFLAGS="-fPIC"
./config --prefix=/opt/openssl shared enable-ec enable-ecdh enable-ecdsa
make all
make install
Now, your Ruby is probably still linked against the old OpenSSL library, so you'll need to rebuild it to link to the new one.
Are you using rvm? Then great! Any new Rubies you install will build against the new OpenSSL. rvm remove your Ruby and re-install it (or simply install a different ruby version).
Not using rvm? Then I guess you'll need to rebuild Ruby the traditional way. But you probably already know how to do that, right? If not, you'll need to look in a different tutorial, because we can't cover that here.
Now reinstall bunder and do a bundle install, and your rails server should now run successfully.
(If anyone has corrections or clarifications to offer, please leave a comment and I'll make edits as necessary.)
I ran into this same problem with CentOS 6.6. But I didn't want to recompile a custom openssl and ruby to fix this. I didn't take very good notes because I tried so many things, but it appears that an update to all of the latest & greatest packages to CentOS 6.7 solves the problem.
Here are a few relevant package versions I have:
openssl098e-0.9.8e-18.el6_5.2.x86_64
openssl-1.0.1e-42.el6.x86_64
openssl-1.0.1e-42.el6.i686
openssl-devel-1.0.1e-42.el6.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
kernel-2.6.32-573.7.1.el6.x86_64
After updating these packages, rebooting, and reinstalling my bundle the json-jwt gem worked perfectly.
This was our production machines, and I believe the ruby standard libs were compiled from source, then created as a custom RPM.
Our build server uses RVM, and this ended up being more of a pain. The RVM installer kept pulling binaries for centos, and the same failure came back again.
Found remote file https://rvm.io/binaries/centos/6/x86_64/ruby-1.9.3-p484.tar.bz2
I forced a source recompile like this:
rvm reinstall --disable-binary ruby-1.9.3-p484
And I noticed a very wonderful looking message:
#applying patch .rvm/patches/ruby/ssl_no_ec2m.patch.
That patch file has some C macro conditions that appear to exclude some EC related code.
And that worked! I also noticed that ruby's openssl.so has a lot of EC related symbols in it. The previously packaged centos ruby did not have these:
$ cd ~/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-linux
$ strings openssl.so |grep _EC
PEM_write_bio_ECPKParameters
i2d_ECPKParameters
PEM_read_bio_ECPKParameters
d2i_ECPKParameters
PEM_write_bio_ECPrivateKey
i2d_ECPrivateKey_bio
i2d_EC_PUBKEY_bio
PEM_write_bio_EC_PUBKEY
PEM_read_bio_ECPrivateKey
PEM_read_bio_EC_PUBKEY
d2i_ECPrivateKey_bio
d2i_EC_PUBKEY_bio
OPENSSL_1.0.1_EC
EVP_PKEY_assign_EC_KEY
OP_SINGLE_ECDH_USE
If I had to guess, the recompile against my new openssl 1.0.1 package must have triggered some C macros that opened up some kind of alternative algorithm that isn't legally protected.
If you check your openssl.so for symbols and it doesn't have all of these _EC related stuff, that's probably an issue.
eze#eze:~/Appp$ rbenv local
rbenv: no local version configured for this directory
eze#eze:~/Appp$ rbenv global
2.2.1
eze#eze:~/Appp$ rbenv versions
* 2.2.1 (set by /home/eze/.rbenv/version)
I recently uninstalled and reinstalled ruby with rbenv, but when I installed again I realized that everything worked except from the rails console, this is the output error
/home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- set (LoadError) from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/index.rb:1:in
`<top (required)>' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/source/rubygems.rb:204:in `fetch_specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/source/rubygems.rb:66:in `specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/lazy_specification.rb:53:in
`__materialize__' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/spec_set.rb:88:in `block in materialize' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/spec_set.rb:85:in `map!' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/spec_set.rb:85:in
`materialize' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/definition.rb:133:in `specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/definition.rb:178:in `specs_for' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/definition.rb:167:in
`requested_specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/environment.rb:18:in `requested_specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/runtime.rb:13:in `setup' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler.rb:120:in
`setup' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/setup.rb:7:in `
<top (required)>' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in
`require' from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/commands.rb:33:in `
<module:Spring>' from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/commands.rb:4:in `
<top (required)>' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/server.rb:9:in
`
<top (required)>' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in
`require'
Solution:
Do gem update --system. It appears that you hadn't installed an updated version of rubygems to go with your new version of Ruby.
Sorry I took so long to get to a solution that worked for you, it seems more obvious now. :)
Original Answer:
Have you made sure that the global (or possibly local, if you have one set) Ruby version is set correctly with rbenv? Have you tried doing rbenv rehash.
It looks like you're missing the Set module in the Ruby standard library for some reason- but since I believe it is part of the standard library and should be there unless your Ruby installation is somehow broken, it makes me wonder if the shims installed by rbenv might be pointing at the wrong place. rbenv rehash should fix that problem, I believe, if that is the cause.
Otherwise, is there any more information about your environment you can give? Such as the output of
rbenv local
rbenv global
rbenv versions
Also, how are you starting the rails console?
Are you doing rails console in your project's directory?
If you start irb and then do require 'set', does it work, or does it throw an error?
I'm trying to get started with the excellent deliver tool (https://github.com/KrauseFx/deliver) but I know nothing about ruby. So when I try to run deliver init and I get this message, I don't know what to do about it:
/Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2052:in `raise_if_conflicts': can't activate json-1.6.8, already activated json-1.8.1 (Gem::LoadError)
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1262:in `activate'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:96:in `block in require'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `each'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `require'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0#global/gems/deliver-0.3.6/lib/deliver.rb:1:in `<top (required)>'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0#global/gems/deliver-0.3.6/bin/deliver:5:in `<top (required)>'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/bin/deliver:23:in `load'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/bin/deliver:23:in `<main>'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
What should I do? By the way I'm on MacOSX Yosemite.
If you are using bundler and you have a Gemfile you can try to run it with bundle using:
bundle exec deliver init
In that way Gemfile will pick for you the right version of the json gem.
If you aren't using bundler you should uninstall the newer version of json using:
gem uninstall json
and choosing the 1.8.1 to uninstall. Then you can try to run again deliver init
As a matter of fact, all I had to do was to install json with "sudo gem install json" and it solved my problem.
I'm trying to get started with Compass & Sass. I've installed the compass gem with three versions of ruby (1.9.1, 1.9.2, 1.9.3) and each time I get the same error:
martin#crunchbang:~$ compass
/home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/shared_helpers.rb:22:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:213:in `default_gemfile'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:164:in `root'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:123:in `load'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:114:in `setup'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.1/bin/compass:25:in `<top (required)>'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `load'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `<main>'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
How can I resolve this issue?
Any help is much appreciated.
I've found the answer here, there seems to be some sort of issue with the compass gem and the new version of bundler.
To resolve just run:
rubygems-bundler-uninstaller