Problems with installing mail gem for Rails 3 - ruby-on-rails-3

I'm trying to install rails 3.0.7 on Mac OSX. I'm using rvm and I've got ruby 1.9.2p180 installed.
When I run
gem install rails --version 3.0.7
It seems to work fine, until it gets to the mail gem.
Fetching: mail-2.2.17.gem (100%)
ERROR: While executing gem ... (Zlib::DataError)
invalid block type
The installer them stops and rails is not installed. How do I get around this?
Update: Since I asked this question the mail gem has been updated to 2.2.19, and this seems to have solved the problem.

I just replicated your env (MacOS, ruby 1.9.2) and rails installed fine, along with the mail gem (2.2.17).
Perhaps try again? Maybe the package that was fetched was temporarily corrupt. You can also run gem with the verbose flag to see more info:
gem install rails -V --version 3.0.7

Related

gem not working after installing 'thin' - rails 3.2.8

I got stuck in a dead end after trying to install the gem 'thin' on the environment
RHEL 6.0
Ruby 1.9.3
Rails 3.2.8
As indicated, I added
gem 'thin'
to my Gemfile and ran
bundle install
The installation seemed to be successful, but after that, whenever I run 'gem', I get
<internal:prelude>:8:in `lock': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
ERROR: Failed to build gem native extension.
deadlock; recursive locking
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/extensions/x86_64-linux/1.9.1-static/eventmachine-1.0.3/gem_make.out
While if I run again 'bundle install' I get
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at
http://bit.ly/bundler-issues. Thanks!
<internal:prelude>:8:in `lock': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
ERROR: Failed to build gem native extension.
deadlock; recursive locking
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/extensions/x86_64-linux/1.9.1-static/eventmachine-1.0.3/gem_make.out
I even tried to follow troubleshooting at https://github.com/bundler/bundler/blob/master/ISSUES.md but nothing has changed.
Looks like there's something corrupted in the eventmachine gem installation, but I can't neither uninstall or reinstall it.
Has anybody got an idea?
I would like at least to be able to revert to the (working) configuration prior to thin installation....

Getting Rails working with a JS runtime environment

I'm using Ubuntu 11.10 and the terminal to install and run Rails. Here
is the process I've taken so far to setup Rails:
download and install Ruby 1.9.2 and Rails 3.1.0
-- I did this using sudo apt-get ruby1.9.1 and sudo gem install
rails
I made a new rails app using rails new path/to/app
I went to the new app directory and tried running rails server and got an
error about not having a JS ruby environment
I had to get a JS runtime environment for execjs so I downloaded 'therubyracer'
as well as 'therubyrhino' and added them to my gem file, one at a time like this:
gem
'therubyracer' then ran bundle install
After everything was successful with the install, I ran rails server again
-- with both runtime environments I have had similar errors:
Could not find libv8-3.3.10.4 in any of the sources
Run `bundle install` to install missing gems.
Could not find therubyrhino-1.73.0 in any of the sources
Run `bundle install` to install missing gems.
Bundle knows where these programs live, giving correct pathnames when I
enter bundle show libv8 or bundle show therubyrhino. They are both
in /usr/lib/ruby/gems/1.9.1/gems/_ where all the other gems are
located for the bundle install.
Does anyone know where this exception is coming up in the Rails source
code? Does anyone know how Rails is gathering the gems? Better yet,
anyone had this problem and know how to fix it?
Thanks so much,
Feav
Have you tried starting the server using bundle exec rails server?
This problem has been fixed in a newer version of Rails.

Mac OS X Leopard showing different version of Rails after install

so I'm installing rails with
gem install rails
and I didn't have any version of rails prior to the one I'm installing (3.0.9).
By the time the installation finishes I get the documentation error
Installing ri documentation for rails-3.0.9...
file 'lib' not found
Installing RDoc documentation for rails-3.0.9...
Even though it says that rails 3.0.9 was installed successfully.
If I run
gem list rails
it shows me version 3.0.9, but when I run
rails -v
it shows me version 2.3.5 ( I don't know here that came from ).
See: http://cl.ly/353h1o1b3y3T260L3F3p
Any help please?
If you don't really care, just remove rails 2.3.5 with gem uninstall rails and chose the appropriate one when it asks you which.

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!

Problem installing Heroku with Rails3, Ruby 1.9.2

I am using Ubuntu 10.10, RVM and Ruby 1.9.2 and trying to install Heroku for the first time. Ruby 1.9.2 is the default for RVM and the only version I have been using.
The gem install heroku worked but trying to run heroku leads to "command not found" error. The executables folder /home/mike/.rvm/gems/ruby-1.9.2-p0/bin is already in the PATH. However, I see that Heroku was installed in /var/lib/gems/1.8/gems. gem list heroku does not show any installed gem. Simply creating symbolic links in .../ruby-1.9.2-p0 did not solve the problem, though it gives a different error:
/usr/lib/ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem heroku (>= 0) (Gem::LoadError)
from /usr/lib/ruby/1.8/rubygems.rb:214:in `activate'
from /usr/lib/ruby/1.8/rubygems.rb:1082:in `gem'
from /home/mike/.rvm/gems/ruby-1.9.2-p0/bin/heroku:18
I don't understand gem and rvm well enough to know what to try next. I read in another question that Heroku supports Ruby 1.9.1 but not 1.9.2 but don't know if that is still true. If so, how does one use Rails and Ruby 1.9.x with Heroku?
The problem turned out to be related to sudo and Ubuntu. RVM depends on the rvm_path environment variable to get started. According to answers to another question, sudo does not preserve the PATH variable in some versions of secure Linux. I don't know if it should ever preserve the rvm_path variable, but in any case, it does not on my version of Ubuntu. So the result of sudo gem install is that the default, RVM-provided version of Ruby is not available during the installation, and the system-default is used. In my case that is version 1.8. The installation appears to succeed, but it is not going to the right gem version.
The solution was simply to use gem install instead of sudo gem install.
If 'gem list' doesn't show the Heroku gem then that would seem to be the problem (the error you posted occurs when running a Heroku command without the gem installed).
Have you tried installing it again? Any error messages?
It does work with 1.9.2.
Had the exact same problem on Mac OSX 10.6.5. Reinstalling without sudo worked in this case also. Thanks for the explanation... being a nube, I would have never figured it out.