rails gem permissions problem (tabs on rails)
I'm having trouble running a gem, tabs on rails -v=1.3.2, in my rails 2.3.8 app. The gem is installed locally (Ubuntu 10.10) and I have config.gem "tabs_on_rails", :version=>"1.3.2" in environment.rb. This is the output I get when I run script/server:
loren@ubuntu:~/apps/medmentum$ script/server
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
no such file to load -- tabs_on_rails
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:164:in `process'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
/home/loren/apps/medmentum/config/environment.rb:11
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:84
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:158:in `read': Permission denied - /var/lib/gems/1.8/gems/tabs_on_rails-1.3.2/rails/init.rb (Errno::EACCES)
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:158:in `evaluate_init_rb'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:154:in `evaluate_init_rb'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:48:in `load'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:38:in `load_plugins'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:37:in `each'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:37:in `load_plugins'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:369:in `load_plugins'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:165:in `process'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
from /var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
from /home/loren/apps/medmentum/config/environment.rb:11
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /var/lib/gems/1.8/gems开发者_Python百科/rails-2.3.8/lib/commands/server.rb:84
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3
When I run rake gems:install, I get this:
Permission denied - /var/lib/gems/1.8/gems/tabs_on_rails-1.3.2/rails/init.rb
I navigated to the tabs_on_rails gem folder in the filesystem and all of the files are locked. According to the files' properties, I am not the owner and cannot change the permissions. All of my other local gems are accessible without permissions problems, so this is odd. Any help is very much appreciated!
The same error affected the release 2.0.0.pre
.
I just released a maintenance version for the 1.3.x branch. Please install it and let me know if it works.
$ gem install tabs_on_rails -v 1.3.3
Also, the next time consider opening a ticket.
I think I solved the problem, but this may be more of a band-aid than a permanent solution. I stumbled upon this line of code[1]:
$ sudo chmod -R a+r /var/lib/ruby/gems/1.8/gems
The problem is that the permissions have been improperly set by the gem's author, and this line of code supposedly corrects said permissions.
[1] http://blog.innerewut.de/2008/7/8/gem-permissions
精彩评论