I am supposed to install ruby labs on my computer and the instructions given to me are found here: http://ix.cs.uoregon.edu/~conery/eic/software.html
However, I'm facing problems downloading the ruby labs gem. The command given was:
gem install --user-install rubylabs -n .
I keep receiving these errors:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Users/Admin/.gem/ruby/1.8 directory.
I then did sudo gem install --user-install rubylabs -n .
But i got this error instead:
Successfully installed rubylabs-0.9.8
Installing ri documentation for rubylabs-0.9.8
/Users/Admin/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/Users/Admin/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Furthermore, after proceeding on with ruby lab-setup.rb, when I type irb, i receive this error as well: no such file to load -- rubylabs
===============================
Apparently it was my RVM that was causing the problem and deleting it solved the above problem. However, I would like to understand why RVM cause those issues.
Could someone please help? I'm at my wits end.
Thanks
I just had this issue as well:
no such file to load -- rubylabs
ruby lab-setup.rb basically adds lines to require rubygems and rubylabs on each new IRB session. The above no such file to load basically meant that rubylabs is not installed locally in rvm. A gem list command would reveal something like the following:
MBA:~ user$ gem list
*** LOCAL GEMS ***
gem-wrappers (1.2.4)
rvm (1.11.3.9)
I am new to Ruby as well... So what I did was basically just run the following command to install rubylabs:
gem install rubylabs -n .
A gem list would reveal it as installed:
*** LOCAL GEMS ***
gem-wrappers (1.2.4)
rake (10.1.1)
rubygems-test (0.4.3)
rubylabs (0.9.8)
rvm (1.11.3.9)
IRB will now run normally.
Related
user#machine:~$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.8)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.4)
net-telnet (0.1.1)
power_assert (0.2.7)
psych (2.0.17)
rake (10.5.0)
rdoc (4.2.1)
sass (3.4.23)
test-unit (3.1.7)
user#machine:~$ sudo gem uninstall rake
ERROR: While executing gem ... (Gem::InstallError)
rake is not installed in GEM_HOME, try:
gem uninstall -i /usr/share/rubygems-integration/all rake
user#machine:~$ sudo gem uninstall -i /usr/share/rubygems-integration/all rake
Remove executables:
rake
in addition to the gem? [Yn] Y
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/share/rubygems-integration/all/bin directory.
user#machine:~$ ls /usr/share/rubygems-integration/all/
specifications
user#machine:~$
I can not uninstall this gem in particular, neither use it :(
If seems that it doesn't exist.
My ruby verison is 2.3.1.p112
Ideally you would use RVM or rbenv to create a local sandbox and handle your Ruby install and gems instead of the system default. Then you won't have to use sudo you can just use gem uninstall <gem>. It doesn't let you have access for a reason, so it's harder to accidentally mess up the system Ruby.
If you can just read these install directions to get set up with RVM and then install the gems you used previously in your new environment. It'll save you a lot headaches in the future managing Ruby and gems.
--
If you don't want to do that you could try this answer
Try this answer from this related question.
gem list -d 'name of gem' and note the "Installed at:" location
sudo gem uninstall 'name of gem' -i 'the path noted above'
If it still returns a permissions error. Create a folder /bin, in the path above. Continue uninstalling as in step 2, still using the original path (/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8).
sudo is not a magic wand that casts a spell “do it anyway.”
When you list your gems, you execute plain gem list from the user. It lists gems installed for the user. Afterwards you try sudo gem uninstall rake. Why do you expect superuser’s list of gems being the same as user’s one?
To remove user’s gems, listed with gem list, use gem uninstall rake. Without sudo.
To list superuser’s gems, that you were tried to remove with sudo gem uninstall rake, use sudo gem list. With sudo.
More info on sudo: http://aplawrence.com/Basics/sudo.html
After "bundle install", I keep getting this error for many times.
Errno::EACCES: Permission denied # rb_sysopen - /Users/daisukeishii/tasca- io/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4/.gemtest
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
gem install pg keeps giving the same error
-ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
-psql (PostgreSQL) 9.5.0
-Mac El Capitan
-I checked all related posts in stackoverflow but could not solve this.
Tried to uninstall/install PostgreSQL through brew.
Tried to uninstall/install Ruby
Do you have any idea to solve this?
I had problems installing the pg gem and for me this did the trick:
ARCHFLAGS="-arch x86_64" gem install pg
However, looking at your error message it actually seems to be about not having write permissions to the gem directory. Maybe you have tried to install the gem as root with sudo gem install pg and it left behind a directory under your home directory having root as owner instead of your regular user.
Remove the directory using:
sudo rm -rf /Users/daisukeishii/tascaio/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4
And then try installing again using the ARCHFLAGS above.
Note that your post has some sort of copy paste problem in the path so the path in this example might not be correct.
In my case, the pg gem was looking for a PostgreSQL installation in the wrong place, so I runned
bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql/9.4.5/bin/pg_config
which was where my PostgreSQL installation actually was, and then
bundle install
I have tried to install atomic gem via bundler. I'm getting the below error message:
**Installing atomic 1.1.13 with native extensions The system cannot find the path specified.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.
c:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in
c:/Ruby200/lib/ruby/gems/2.0.0/gems/atomic-1.1.13 for inspection.
Results logged to
c:/Ruby200/lib/ruby/gems/2.0.0/gems/atomic-1.1.13/ext/gem_make.out An
error occurred while installing atomic (1.1.13), and Bundler cannot
continue.**
Could you help me to overcome from this issue. Thanks
To help you here are some steps to follow in order to install your gem lacally.
Download atomic 1.1.13 from RubyGems:
atomic 1.1.13
Place the downloaded gem into a file called gems
Open Ruby cmd consol [clic on start button, select Ruby then select Start command prompt with Ruby]
Cd to the gems file path [lets supose the path of your gems file is C:\Desktop\gems] write the command: cd C:\Desktop\gems then clic enter.
To install the gem run the following comand: gem install --local atomic-1.1.13.gem
I tried it and it worked for me, hopefuly it will work for you.
When I run 'gem install bundler' for example, it works fine if I am running ruby version 1.9.3, but when running ruby 2.1.2, it seems not to see the 'bundler' arg and gives me
ERROR: While executing gem ... (Gem::CommandLineError)
Please specify at least one gem name (e.g. gem build GEMNAME)
I see this on two different systems running rbenv.
Here is the last part of the output when running with RBENV_DEBUG=1:
+ [rbenv-exec:45] export PATH=/home/ded/.rbenv/versions/2.1.2/bin:/home/ded/.rbenv /libexec:/home/ded/.rbenv/plugins/bundler/bin:/home/ded/.rbenv/plugins/ruby-build/bin:.bundle/bin:/home/ded/.rbenv/shims:/home/ded/.rbenv/bin:/home/ded/.cabal/bin:/home/ded/.emacs/ded/lisp/ecukes:/home/ded/local/node/bin:/home/ded/j64-701/bin:/home/ded/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/plan9/bin
+ [rbenv-exec:45] PATH=/home/ded/.rbenv/versions/2.1.2/bin:/home/ded/.rbenv/libexec:/home/ded/.rbenv/plugins/bundler/bin:/home/ded/.rbenv/plugins/ruby-build/bin:.bundle/bin:/home/ded/.rbenv/shims:/home/ded/.rbenv/bin:/home/ded/.cabal/bin:/home/ded/.emacs/ded/lisp/ecukes:/home/ded/local/node/bin:/home/ded/j64-701/bin:/home/ded/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/plan9/bin
+ [rbenv-exec:47] exec -a gem /home/ded/.rbenv/versions/2.1.2/bin/gem install bundler
ERROR: While executing gem ... (Gem::CommandLineError)
Please specify at least one gem name (e.g. gem build GEMNAME)
Any suggestions what could be going wrong?
Changed my ~/.gemrc from
gem: --document
to
gem: --ri-document
and that solved the problem. Not sure why it was not a problem with ruby 1.9.3.
Try to uninstall all
** $ sudo gem uninstall --all**
2.try to install ruby
** $ sudo gem install ruby**
then install cocoapods then perfectly working
$ sudo gem install cocoapods
I uninstalled RVM and re-installed using a single user installation using:
\curl -L https://get.rvm.io | bash -s stable
When I do bundle, it prompts for:
Enter your password to install the bundled RubyGems to your system:
I tried using the answer in "ERROR: While executing gem … (Gem::FilePermissionError)" which did not fix it.
Then, while trying to install the gem manually, I got:
Gem::InstallError: nokogiri requires Ruby version >= 1.9.2.
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
then running gem install nokogiri -v '1.6.0' returned:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
I checked all the similar posts on SO, but they didn't solve the problem. What am I missing?
I spent a lot of time fixing this issue on my MacBook. The gem update --system does not work for me.
At last, putting the following code in the ~/.zshrc file and create a new zsh session works for me.
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$HOME/.gem"
after you install RVM you still need few more steps:
Load RVM to the current shell:
source ~/.rvm/scripts/rvm
Usually this would not be needed if you close and open your terminal again
Install ruby:
rvm install ruby
Use ruby:
rvm use ruby
The last step is very important as your error message mentioned system ruby not the one controlled by RVM.
Make sure to update your system rubygems with this command : sudo gem update --system --no-user-install.
bundler use it instead your local version and your bundler version could be incompatible with your system rubygems.
It works for me ;)