How to uninstall a gem from Rubymine - ruby-on-rails-3

I'm a n00b in Rails and Rubymine IDE. The Rubymine Help says to
To uninstall gems, use command line procedure. So doing, the
recommended command format depends on the Ruby gems version you use.
gem uninstall <gem_name>
Could not how to figure out where to run the command and the Help does show this either. Let me know if there are any add'l steps that need to be done, such as unbundling the gem.
Thanks in advance.

Just run in the terminal/console a command:
gem install <gem_name>
In case if you using several RVM sets, then go to File/Setting/Ruby SDK and Gems and check which gem set used by RubyMine. Then check the gemset in terminal by command:
rvm gemset list
You will see the current gem set, you can change it if you need by command:
rvm gemset use <gemset_name>
And then do the uninstalling.

Related

RVM doesn't recognize installed gem, so bundle install fails

Bundle install command fails because gem install pg fails:
Make sure that `gem install pg -v '0.17.1'` succeeds
I can though, install pg with certain options:
gem install pg -- --with-pg-include=/usr/pgsql-9.3/include --with-pg-dir=/usr/pgsql-9.3
Still.. running bundle install fails, saying:
Make sure that `gem install pg -v '0.17.1'` succeeds
Well ye I know it fails, that why I installed it before, with options given,
How do I make the bundle see it the gem is already installed.? (or maybe make the bundle command to run gem install pg -- --with-pg-include instead of gem install pg -v '0.17.1' so it will succeed)
I also use rvm, and i'm rather clueless about it, so maybe even though I the pg gem is installed:
gem list pg
*** LOCAL GEMS ***
pg (0.17.1)
The application doesn't recognized the installed pg gem? if so How do I make the application's rvm see that the required gem is already installed?
Thank you
Finally found answer: How can I pass a parameter for gem installation when I run bundle install?
So in my case:
bundle config build.pg --with-pg-include=/usr/pgsql-9.3/include --with-pg-dir=/usr/pgsql-9.3
bundle install
And that took a day, well could have been worse
So you know in the future, this wasn't an RVM issue. This was a bundler and gem command parameter passing issue. RVM wasn't involved at that stage.

WebStorm LESS Filewatcher Could not find RubyGem less

I'm getting this error trying to use the WebStorm LESS File Watcher
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem less (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /Users/me/.rvm/gems/ruby-1.9.3-p194/bin/lessc:18
from /Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14
I'm running OSX Mountain Lion
How do I fix it?
EDIT:
I did this...
gem install less
Successfully installed less-2.3.2
1 gem installed
Didn't help.
EDIT 2:
I fiddled with the path in the LESS Filewatcher setup panel
and now I get this
/Users/me/.rvm/gems/ruby-2.0.0-p195/bin/lessc --no-color bootstrap.less
env: ruby_noexec_wrapper: No such file or directory
It feels like progress, but alas I'm not compiling less to css yet.
You don't need to remove any ruby version. Just switch to the system version of ruby and install the compiler.
rvm use system
sudo gem install less
rvm use default
Ok what I did was this
With rvm remove all other versions of ruby
rvm remove 2.0.0-p195
Install this gem in the system version of ruby
sudo gem install rubygems-bundler
install the less gem
sudo gem install less
sudo gem install therubyracer
I am sure someone can give me a better way of doing this but this ruby thing has a pretty steep learning curve that I really am not interested in pursuing.
This is the way I did it...if someone wants to contribute a better way please share here to save someone else the 4 hours I just lost to it.

Rails Server Won't Run on OS X Lion

I'm a beginner programmer and I'm trying to get the rails server to run on OS X Lion. When I type "rails server" into the command line, I get this error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /usr/bin/rails:18
What do you think a solution to the problem is? Any help you can provide would be greatly appreciated. Thanks!
You need to install the rails gem. You could probably do this by running bundle install inside that project.
Have you installed the Rails Gem?
gem install rails
Then do a gem list to see if Rails is in there.
It's also important that you be in the proper directory. So if you keep all of your apps in /apps/ make sure you are in /apps/my_app before calling the server command.
The Ruby bundled with OS X is too old for Rails 3.
I would recommended using 'rvm' to install the latest stable version of ruby-1.9.2-p260
Since installing ruby requires some compilation, make sure you have a gcc installed. You can install XCode to get an usable gcc.
To install rvm, you need bash, git and curl.
RVM: http://beginrescueend.com/
After that, you can use
gem install rails
Enjoy!
The Lion Server looks at a non-default path for the gem file
For example have a look at the first line of /usr/share/devicemgr/backend/devicemgrd:
#!/usr/bin/env GEM_HOME=/usr/share/devicemgr/webserver/gems GEM_PATH=/usr/share/devicemgr/webserver/gems RAILS_ENV=production /usr/bin/ruby
So to install the missing gems, make sure to install them at the required path:
sudo GEM_HOME=/usr/share/devicemgr/webserver/gems gem install rails

Project broken with Bundler errors after RVM install

I installed RVM and installed 3 different rubies: 1.8.7, ree, and 1.9.2.
I have a Rails 3.0.9 project that uses 1.8.7.
Now when I try to run the 3.0.9 project, I get this error:
Could not find xml-simple-1.1.0 in any of the sources
However, the following command:
bundle show xml-simple
yields:
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/xml-simple-1.1.0
Looks right to me. What am I missing here? The application, when running, is clearly not seeing the right path. Yet Bundler, when run at the command line, sees it just fine. I am not certain where these paths are to be set. I am admittedly new to RVM, I installed it because I want to start a new edge project with 1.9.2.
Thank you for any help you can provide.
I needed to learn how to create a gemset, then switch to that gemset. You can always check your gem and ruby environment with rvm using:
rvm info
That's what clued me in. Once I "use"d the appropriate gemset where the gem was installed, it worked great.

Ubuntu 11.04 Ruby on Rails install write permissions error

I am trying to install rails and have installed rvm and am trying to install rails but it is saying I do not have write permissions.
$ gem install rails --version 3.0.7
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /var/lib/gems/1.8 directory.
When I try sudo it give me this error, I know that you can use --no-ri --no-r-doc but even when I did this rails was not installed properly. Does anyone have any ideas?
$ sudo gem install rails --version 3.0.7
Successfully installed rails-3.0.7
1 gem installed
Installing ri documentation for rails-3.0.7...
file 'lib' not found
Installing RDoc documentation for rails-3.0.7...
file 'lib' not found
from my experience with rvm, gems should't stay in /var/lib/
if you didn't specifically asked for this, there might be a problem with your rvm installation
if so, i would definetly recommend a clean rvm install by following ryan bigg's guide of installing rvm. i followed it every time and never ever had the slightest problem after.
hope this helps!