I am on Windows 7 and want to use http://hospice.io/. This requires Ruby gem librarian so I installed ruby 2.0 using http://rubyinstaller.org/ then downloaded RubyGems 1.8.25 from http://rubyforge.org/frs/?group_id=126 and updated (gem update --system). I installed librarian.
ruby setup.rb
gem install librarian
Now I am in the folder with my Vagrant box and want to do command librarian-chef but I get
'librarian-chef' is not recognized as an internal or external command, operable program or batch file.
I tried it when running ruby devkit/msys with the same result. Any suggestions how to run it please? I would guess there is a problem with PATH but when gem install works why doesn't librarian-chef work too?
gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/bin/ruby/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: C:/bin/ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/bin/ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/bin/ruby/lib/ruby/gems/2.0.0
- C:/Users/Andrew/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
Also, might want to add that I started development on a Windows machine back in ruby 1.8.7 and through ruby 1.9.3 and then switched to Ubuntu 12.04. My development time probably cut in half or maybe even a quarter. I don't know if this has changed with Ruby 2+
I encourage you to look at having a dual boot with Ubuntu, the small investment in setup will save you TONS of time in dealing with making windows act like linux and give you the added benefit of setting up your development environment exactly like it will be in production if you will be running something like unicorn/nginx.
Related
I am desperatly trying to set up Redmine on my debian server. I managed almost everything (the interface works with webrick), but I want it to be accessable via dev.kaleydra.de, I wanted to solve this by using passenger+the apache2 module.
So now my current status is this message when I visit dev.kaleydra.de
Error message:
Redmine requires Bundler. Please install it with gem install bundler.
But bundler is definitly installed! (bundle install worked perfectly)
Some information:
gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9.1
- /root/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
I tried adding this to the enviroment.rb:
ENV['GEM_HOME']='/usr/local/lib/ruby/gems/1.9.1'
ENV['GEM_PATH']='/usr/local/lib/ruby/gems/1.9.1'
What I might notice is that I can't run
passenger-install-apache2-module
because it won't let me install libpq5 (Plesk uses a newer version and it specificly requests "libpq5 (= 8.4.13-0squeeze1)" with apt-get), but since passenger is showing the page makes it look like it already works...
I am kind of desperate, any clues?
I need your apache config file.
If you have all the needed gems installed but passenger still complain no gem found, please check if your 'apache user' has the privilege to access the gem folder.
e.g. your gems is installed by root but your apache-user is non-root, then this error occurs.
the solution is quit simply, if there's a account named root (e.g. in Centos) just these lines to your apache config file (httpd.conf or so)
User root
Group root
more details about "root, apache", see this post: https://serverfault.com/questions/103644/apache-user-root-access
I am a beginner with Ruby development, so apologies this is a face palm question.
On mac OSX I installed ruby 1.9.3, and then installed a gem via command 'gem install selenium-webdriver', I then installed eclipse as IDE.
I then wrote a simple class requiring the 'selenium-webdriver' gem.
class Cheese
require 'rubygems'
require 'selenium-webdriver'
... rest of code class.
I can run cheese.rb without issue from the command line using irb or ruby (i.e. ruby ./path to file/cheese.rb)', but when running the script via the eclipse GUI i get an error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- selenium-webdriver (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/bryan/Documents/workspace/New Se Project/Cheese.rb:3
This would indicate a config issue with Eclipse. Note the installed default ruby version is 1.9.3 from rvm - list, but Eclipse is still 'bound' to 1.8. Googling indicates this is probably a PATH issue, but i'm not familiar with environment variables on Mac OSx.
*How can i reconfigure Eclipse (or Aptana) to 'see' the installed gems? *
Further info:
Bryans-MacBook-Air:Library bryan$ which ruby
/Users/bryan/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
Bryans-MacBook-Air:Library bryan$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin11.4.0]
- INSTALLATION DIRECTORY: /Users/bryan/.rvm/gems/ruby-1.9.3-p194
- RUBY EXECUTABLE: /Users/bryan/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
- EXECUTABLE DIRECTORY: /Users/bryan/.rvm/gems/ruby-1.9.3-p194/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/bryan/.rvm/gems/ruby-1.9.3-p194
- /Users/bryan/.rvm/gems/ruby-1.9.3-p194#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Bryans-MacBook-Air:Library bryan$ echo $PATH
/Users/bryan/.rvm/gems/ruby-1.9.3-p194/bin:/Users/bryan/.rvm/gems/ruby-1.9.3-p194#global/bin:/Users/bryan/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/bryan/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
I was having the same problem. I first tried this tutorial: http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/
This did not help.
Then I saw this entry in superuser: https://superuser.com/questions/154292/ruby-rubygems-why-do-i-always-get-error-messages-when-trying-to-install-gems and running gem install using sudo helped me.
New to Ruby and using RailsTutorial book to learn. I'm on Windows 7 machine using cygwin.
Anyway, I started using Ruby 1.8.7 (default on cygwin) and installed the gems, rails, git, etc. All working fine, but got to step to deploy app with Heroku and it required Ruby 1.9.2.
After research, I decided to uninstall Ruby 1.8.7 (through cygwin uninstall) and then compiled from source Ruby 1.9.2. I reran gems and installed rails again.
When I run rails -v though, I get -bash: /usr/bin/rails: /usr/bin/ruby.exe: bad interpreter: Permission denied.
Any ideas on how to get rails working again?
Thanks!
Here's output of gem env:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.12
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i386-cygwin]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby.exe
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-cygwin
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9.1
- /home/Philip/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Fix the permissions of /usr/bin/ruby.exe as said in the comment.
And if that doesn't help,
I'd say you re-install everything again but this time with Administrative privileges.
Open up a terminal with Administrative privileges and repeat the whole process.
BTW, How are you installing Rails on Windows?
Are you using Rails Installer for Windows by EngineYard??
If not, go take a look at the link above and railsinstaller-for-windows-EY-blog
I had the same issue with atlassian-stash gem under cygwin 2.3.1 x86_64 and ruby 2.2.3p173. I tried to fix the permissions for ruby.exe and all the script files, but even rwxrwxrwx permission didn't help.
The stange thing was that the scipt was running smoothly when called directly, but if it was a part of the git alias, it was getting me /usr/bin/ruby.exe: Bad interpreter: permission deined error.
I found that gem engine created some auxiliary files inside ~/bin folder. Removing those files helped.
I'm running Snow Leopard, and installed a custom built Ruby according to the guide here: http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard . My ruby binary lives in usr/local/bin/ruby and my gems are installed in /usr/local/bin/gem . My gem env looks like so:
RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
I think I may have borked the install since all actions taked on gems give the error:
ERROR: While executing gem ... (Errno::EEXIST)
File exists - /usr/local/bin/ruby
How do you edit the environment variables for the gem environment?
And for those of you on OS X and using ruby AND gems, what did you use to get yourself up and running?
I'm thinking of just nuking everything and starting anew.
It looks like your installation of ruby into /usr/local/bin is not the ruby that you're getting, which probably means /usr/local/bin/ is not in your PATH. If you'd like to run that ruby, try editing your .bash_profile to add /usr/local/bin like this:
export PATH=/usr/local/bin:$PATH
Alternately, you can add the path to a file in /etc/paths.d, which is the preferred method for adding paths globally on an OS X system.
I've tried things about three different ways, each with varying results. I have systems with the default install (/usr/bin), hand-built /usr/local/bin and also Mac Ports in /opt/local/bin.
By far, the simplest is to just use the built-in binary, which on 10.6.2 is ruby 1.8.7. In that scheme, gems are installed in /Library/Ruby/Gems. Second simplest is MacPorts (sudo port install ruby), third is the totally from source method you're describing above. Certainly there are good reasons people install from source, but unless you're trying to run ruby 1.9 or another version, you're best off using the built-in ruby 1.8.7.
Does the command "gem env" not report any gem paths? Mine reports a number of gem paths along with teh version of rubygems etc. that yours does not appear to be doing.
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/steveweet/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
You can edit the environment variables associated with gem by specifying them in your shell startup files, (.bashrc for bash). The relevant variables are all listed in the environment page of the gem web site. You will want to pay particular attention to GEM_HOME and GEM_PATH. You can check the current settings of these by typing echo $GEM_HOME at a shell profile
I would suggest that your best action at this moment in time may be to go back to your default ruby installation as provided with OS/X and then download and install rvm (The Ruby version manager) and then watch Ryan Bates screencast
What should I do before upgrading to the latest version of Ruby? any tips?
Update
sorry for my unclear question.
my condition: I've upgraded my Ruby from 1.8.7 to 1.9.1p243. It makes me can not use all installed gems.
so, what should I do before upgrading Ruby? uninstall all my installed gems? I was looking in other SO posts in here, But there are no answers for my question.
Unless you are using custom GEM environment variables or a .gemrc (or some multi ruby system like rvm) then the locations where rubygems are installed for each ruby installation will be different.
You can manage the locations used by rubygems by managing the GEM_HOME and GEM_PATH environment variables or the .gemrc file. It is possible to set your gems to be shared across ruby installations with these variables or the .gemrc
.gemrc:
http://docs.rubygems.org/read/chapter/11
GEM Environment variables:
http://docs.rubygems.org/read/chapter/12#page52
You can find the environment settings for a rubygems installation by running:
/path/to/gem env
This will output something like the following:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.4
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]
- INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/local/bin/ruby
- EXECUTABLE DIRECTORY: /opt/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-10
- GEM PATHS:
- /opt/local/lib/ruby/gems/1.8
- /home/aji/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gemcutter.org"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gemcutter.org
While the number of rubygems that are compatible with ruby 1.9 is constantly growing, you will need to check with the maintainer or homepage of each gem/project to verify if your gems will work or not.
Also check previous questions on SO regarding differences between 1.8 & 1.9:
What is the difference between Ruby 1.8 and Ruby 1.9