I am just getting started learning rails.
I am building my first app using Ruby on Rails tutorial by Michael Hartl.
the book said to use this gem file.
source 'http://rubygems.org'
gem 'rails', '3.0.0.rc'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
group :development do
gem 'rspec-rails', '2.0.0.beta.18'
end
group :test do
gem 'rspec', '2.0.0.beta.18'
end
However I get the following error when I run bundle install in the terminal:
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.0.rc)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.0.rc)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.4)
Using tzinfo (0.3.23)
Using actionpack (3.0.0.rc)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.6.1)
Using actionmailer (3.0.0.rc)
Using arel (0.4.0)
Using activerecord (3.0.0.rc)
Using activeresource (3.0.0.rc)
Using bundler (1.0.0)
Using diff-lcs (1.1.2)
Installing nokogiri (1.4.3.1) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Paths suggest you are using a Mac, right? Maybe this answer solves your problem?
gem install mysql failure in Snow Leopard
Error looks the same. Accepted answer said that "Installing the Xcode that's bundled with the Snow Leopard fixed the problem."
Are you on Linux? Here is a list of common problems you might run into when installing stuff in Ubuntu Linux - http://rbjl.net/20-rubybuntu-2-troubleshooting-common-ruby-ubuntu-problems
I am on Linux and had to do the following to get nokogiri to install:
sudo apt-get install libxml2 libxml2-dev libxslt1-dev
gem install nokogiri (remember to use sudo if you are not using RVM)
Just FYI, Rails 3.0 was released on August 29. So you can use
gem 'rails', '3.0.0'
Related
Using rbenv and Rails 4.2.6, when I run bundle exec rails s or bundle exec rails c, I see the following:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
That's all, nothing else happens. If I then stop spring, and run bundle exec rails c, the following appears:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
dyld: lazy symbol binding failed: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
dyld: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
Any idea what's wrong here? Thanks!
Update: add content of gemfile and ouput of bundle install
Gemfile:
source 'https://rubygems.org'
ruby "2.3.1"
gem 'rails', '4.2.6'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'simple_form'
gem "puma"
gem 'dotenv-rails', :groups => [:development, :test]
gem 'quiet_assets', :group => :development
gem "rails_12factor"
gem 'slack-ruby-client'
gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x'
gem 'bootstrap-sass', '~> 3.3.6'
group :development, :test do
gem 'byebug'
gem 'rspec-rails', '~> 3.4'
gem 'factory_girl_rails', '~> 4.0'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'guard'
gem 'guard-rspec', require: false
gem 'terminal-notifier-guard'
gem 'spring'
end
Output of bundle install:
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using execjs 2.7.0
Using debug_inspector 0.0.2
Using sass 3.4.22
Using byebug 9.0.5
Using coderay 1.1.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using diff-lcs 1.2.5
Using dotenv 2.1.1
Using multipart-post 2.0.0
Using ffi 1.9.10
Using formatador 0.2.5
Using gli 2.14.0
Using rb-fsevent 0.9.7
Using ruby_dep 1.3.1
Using lumberjack 1.0.10
Using nenv 0.3.0
Using shellany 0.0.1
Using method_source 0.8.2
Using slop 3.6.0
Using guard-compat 1.2.1
Using rspec-support 3.4.1
Using hashie 3.4.4
Using multi_json 1.12.1
Using pg 0.18.4
Using puma 3.4.0
Using bundler 1.12.5
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using tilt 2.0.5
Using websocket-extensions 0.1.2
Using spring 1.7.1
Using terminal-notifier-guard 1.7.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using autoprefixer-rails 6.3.6.2
Using uglifier 3.0.0
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using sprockets 3.6.1
Using faraday 0.9.2
Using rb-inotify 0.9.7
Using notiffany 0.1.0
Using pry 0.10.3
Using rspec-core 3.4.4
Using rspec-expectations 3.4.0
Using rspec-mocks 3.4.1
Using rails_12factor 0.0.3
Using websocket-driver 0.6.4
Using sdoc 0.4.1
Using activesupport 4.2.6
Using loofah 2.0.3
Using mail 2.6.4
Using bootstrap-sass 3.3.6
Using faraday_middleware 0.10.0
Using listen 3.1.5
Using rspec 3.4.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using factory_girl 4.7.0
Using jbuilder 2.5.0
Using rails-html-sanitizer 1.0.3
Using slack-ruby-client 0.7.4
Using guard 2.14.0
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using guard-rspec 4.7.2
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.0.4
Using simple_form 3.2.1
Using coffee-rails 4.1.1
Using dotenv-rails 2.1.1
Using factory_girl_rails 4.7.0
Using jquery-rails 4.1.1
Using quiet_assets 1.1.0
Using rails-i18n 4.0.8 from git://github.com/svenfuchs/rails-i18n.git (at rails-4-x#129b9fb)
Using rspec-rails 3.4.2
Using rails 4.2.6
Using sass-rails 5.0.4
Using web-console 2.3.0
Using turbolinks 2.5.3
Bundle complete! 25 Gemfile dependencies, 102 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Update 2 - added bundle exec gem pristine --all
bundle exec gem pristine --all
Restoring gems to pristine condition...
Restored rake-11.2.2
Restored i18n-0.7.0
Skipped json-1.8.3, it is a default gem
Restored minitest-5.9.0
Restored thread_safe-0.3.5
Restored tzinfo-1.2.2
Restored activesupport-4.2.6
Restored builder-3.2.2
Restored erubis-2.7.0
Restored mini_portile2-2.1.0
Restored pkg-config-1.1.7
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Ext::BuildError)
ERROR: Failed to build gem native extension.
current directory: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8/ext/nokogiri
/Users/nandersen/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160620-6035-1m3373p.rb extconf.rb
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
/Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find nokogiri-1.6.8 in any of the sources (Bundler::GemNotFound)
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `map!'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `materialize'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in `specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:185:in `specs_for'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:174:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/environment.rb:19:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:14:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:95:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/setup.rb:19:in `<top (required)>'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
extconf failed, exit code 1
Gem files will remain installed in /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8 for inspection.
Results logged to /Users/nandersen/Projects/the-lunch/vendor/bundle/extensions/x86_64-darwin-15/2.3.0-static/nokogiri-1.6.8/gem_make.out
The problem is debug_inspector gem, you could try to remove web-console gem in your Gemfile, bundle install, and run the server again.
UPDATE:
Or if you would like to keep the web-console gem, you could try to remove all the gems you have installed, and re-bundle install them again. According to this issue on rails/web-console.
I was using a cloud9 ide online but I had to install gem rmagick. But the ide did not let me to do and gave an error. So I decided to download my project in to my local area. Then when I try to bundle install, it throws and error for therubyracer.
I though Osx has its own way to handle java part. So if i take out gem rubyracer from gem file, bundle install works fine. But then when i say rails server, i get an error;
rails server
[WARNING] Please install gem 'therubyracer' to use Less.
bin/rails:6: warning: already initialized constant APP_PATH
/Users/emreozkan/Desktop/yedek/Last.1/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]
The most common rails commands are:
generate Generate new code (short-cut alias: "g")
console Start the Rails console (short-cut alias: "c")
server Start the Rails server (short-cut alias: "s")
dbconsole Start a console for the database specified in config/database.yml
(short-cut alias: "db")
new Create a new Rails application. "rails new my_app" creates a
new application called MyApp in "./my_app"
In addition to those, there are:
destroy Undo code generated with "generate" (short-cut alias: "d")
plugin new Generates skeleton for developing a Rails plugin
runner Run a piece of code in the application environment (short-cut alias: "r")
All commands can be run with -h (or --help) for more information.
EDIT 1:
bundle install with gem thrubyracer;
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies......
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.6.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.0
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.1
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.0
Using rack 1.6.0
Using rack-test 0.6.3
Using actionpack 4.2.0
Using globalid 0.3.5
Using activejob 4.2.0
Using mime-types 2.4.3
Using mail 2.6.3
Using actionmailer 4.2.0
Using activemodel 4.2.0
Using arel 6.0.0
Using activerecord 4.2.0
Using ansi 1.5.0
Using bcrypt 3.1.7
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.3.pre1
Using sass 3.4.13
Using bootstrap-sass 3.2.0.0
Using will_paginate 3.0.7
Using bootstrap-will_paginate 0.0.10
Using bundler 1.9.1
Using columnize 0.9.0
Using debugger-linecache 1.2.0
Using slop 3.6.0
Using byebug 3.4.0
Using carrierwave 0.10.0
Using hitimes 1.2.2
Using timers 4.0.1
Using celluloid 0.16.0
Using coderay 1.1.0
Using coffee-script-source 1.9.1.1
Using execjs 2.5.2
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.0
Using coffee-rails 4.1.0
Using commonjs 0.2.7
Using ffi 1.9.8
Using formatador 0.2.5
Using rb-fsevent 0.9.4
Using rb-inotify 0.9.5
Using listen 2.10.0
Using lumberjack 1.0.9
Using nenv 0.2.0
Using shellany 0.0.1
Using notiffany 0.0.6
Using method_source 0.8.2
Using pry 0.10.1
Using guard 2.12.5
Using guard-minitest 2.3.1
Using multi_json 1.11.0
Using jbuilder 2.2.3
Using jquery-rails 4.0.3
Using less 2.6.0
Using sprockets 3.0.1
Using tilt 1.4.1
Using less-rails 2.7.0
Using libv8 3.16.14.7
Using sprockets-rails 2.2.4
Using rails 4.2.0
Using mini_backtrace 0.1.3
Using ruby-progressbar 1.7.5
Using minitest-reporters 1.0.5
Using pg 0.17.1
Using rails_serve_static_assets 0.0.4
Using rails_stdout_logging 0.0.3
Using rails_12factor 0.0.2
Using rdoc 4.2.0
Using ref 1.0.5
Using rmagick 2.13.2
Using sass-rails 5.0.1
Using sdoc 0.4.0
Using spring 1.1.3
Using sqlite3 1.3.9
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/opt/ruby/bin/ruby -r ./siteconf20150421-1458-ss9mv4.rb extconf.rb --pre
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/Cellar/ruby/2.2.1/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/usr/local/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.7/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.7 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
from /usr/local/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.7/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.2.0/gems/therubyracer-0.12.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-11/2.2.0/therubyracer-0.12.2/gem_make.out
An error occurred while installing therubyracer (0.12.2), and Bundler cannot
continue.
Make sure that `gem install therubyracer -v '0.12.2'` succeeds before bundling.
EDIT 2:
My gem file;
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'json', '~> 1.8.2'
gem 'execjs'
gem 'bcrypt', '3.1.7'
gem 'will_paginate', '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'bootstrap-sass', '3.2.0.0'
gem 'carrierwave'
gem 'rmagick', '2.13.2'
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem 'sass-rails', '5.0.1'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
I had a similar problem installing Rails on a Rapsberry Pi because therubyracer has no package for arm processors.
It can be solved installing node.js which you can download here: https://nodejs.org/download/
After you installed it you can remove therubyracer from your Gemfile and run bundle again. After you did that everything should be fine...
// You also need to add this line to your Gemfile:
gem 'execjs'
Then run bundler again.
Its described here: http://ajacevedo.com/2013/using-node-js-as-a-rails-javascript-runtime/
// IN your case the Less Gem requires therubyracer not rails itself. So its a gem specific problem. It has been discribed here: https://github.com/seyhunak/twitter-bootstrap-rails/issues/336
One of the guys seemed to solve it this way:
...
Anyways, removed both gems, 'therubyracer' and 'less-rails-bootstrap'. Now using 'bootstrap-sass'.
Just started up in Rails. I'm on windows vista, installed the latest build of ruby from http://rubyinstaller.org/ and everything went well.
ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
I run:
gem update --system
gem sources -a http://gemcutter.org
gem install rails
No errors reported.
rails --v
Rails 3.1.0
after this I created a folder for my Rails project and I created a new Rails app inside as follows:
rails new test
cd test
bundle install
(again no error reported)
But when I run rails server I get this error:
rails server
←[31mCould not find rails-3.1.0 in any of the sources←[
←[33mRun `bundle install` to install missing gems.←[0m
I try to run bundle again but no success again... After this, if I type again rails -v I get the same error as before. I have to close the windows console and reopen for rails -v to start working again!!
Has anyone experience this?! Can you help?
Thanks!!!
As requested the gemfile content is:
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
bundle install result:
Fetching source index for http://rubygems.org/
Using rake (0.9.2)
Using multi_json (1.0.3)
Using activesupport (3.1.0)
Using bcrypt-ruby (3.0.0)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0)
Using erubis (2.7.0)
Using rack (1.3.2)
Using rack-cache (1.0.3)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.0)
Using actionpack (3.1.0)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.0)
Using arel (2.2.1)
Using tzinfo (0.3.29)
Using activerecord (3.1.0)
Using activeresource (3.1.0)
Using ansi (1.3.0)
Using bundler (1.0.18)
Using coffee-script-source (1.1.2)
Using execjs (1.2.4)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using rdoc (3.9.4)
Using thor (0.14.6)
Using railties (3.1.0)
Using coffee-rails (3.1.0)
Using jquery-rails (1.0.13)
Installing rails (3.1.0)
Using sass (3.1.7)
Using sass-rails (3.1.0)
Using sqlite3 (1.3.4)
Using turn (0.8.2)
Using uglifier (1.0.2)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
is installed.
try bundle exec rails server instead of rails server
I'm following this tutorial and I've come to where I need to install these gems:
gem 'rails', '3.0.3'
gem 'sqlite3-ruby', :require => 'sqlite3'
group :development do
gem 'rspec-rails', '2.0.1'
end
group :test do
gem 'rspec', '2.0.1'
gem 'webrat', '0.7.1'
end
Then I do a:
bundle install
But terminal gives me this:
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.3)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.3)
Using erubis (2.6.6)
Using rack (1.2.2)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.26)
Using actionpack (3.0.3)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.16)
Using actionmailer (3.0.3)
Using arel (2.0.9)
Using activerecord (3.0.3)
Using activeresource (3.0.3)
Using bundler (1.0.12)
Using diff-lcs (1.1.2)
Installing nokogiri (1.4.4) /Library/Ruby/Site/1.8/rubygems/installer.rb:574:in `initialize': Permission denied - /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.4/.autotest (Errno::EACCES)
from /Library/Ruby/Site/1.8/rubygems/installer.rb:574:in `open'
I've done a bunch of research on this and I've found some people who had the same problems:
http://taleswithrails.com/2011/01/error-gemfile-could-not-find-gem-webrat/
And I've read the installation guide: http://nokogiri.org/tutorials/installing_nokogiri.html
But I can't get:
sudo port ...
or
sudo apt-get ...
To work. They return with "command not found". So I think I have two issues here...
1) Nokogiri is not installing properly and I'm not sure why. I also don't know what "flavor" of machine I'm running (in other words, which of the Nokogiri installation instructions pertains to my setup).
2) Those commands don't work on my system (OSX 10.6) and I'm not sure why. I've read up on Macports and libxml2 but it's a little unclear to me what it is and what I need to do (or if it's even applicable to me). I did try installing macports, but I don't have Xcode, which is required. But I'm not a "mac developer". Is this my only option?
So it seems like you have several different problems going on at the same time and you need to sort them out one by one.
First, can you run gem install Nokogiri in your terminal, and then try using it in IRB to check that it works?
Then, you should that sudo apt-get is the command for getting software using aptitude which you will NOT be using on your mac, it is used for Linux. and sudo port uses macports to install nokogiri, which will only work if you have Macports installed.
I would recommend getting Homebrew and using brew install nokogiri
once you have it working locally in a ruby script, then worry about rails.
The permission denied error is probably because you have been using some sudo's where you should not be, on a mac you really should never be using that command. If you need to install ruby gems, look into RVM which will let you install 'most' gems without needing to sudo
Ok i keep getting this error
Could not find tzinfo-0.3.24 in any of the sources (Bundler::GemNotFound)
I am using rvm and i just created a gemset and i have this
gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.7)
bcrypt-ruby (2.1.4)
builder (2.1.2)
bundler (1.0.7)
devise (1.1.5)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.14)
mime-types (1.16)
mysql (2.8.1)
paperclip (2.3.8)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
riddle (1.2.2)
thinking-sphinx (2.0.0)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.24)
warden (1.0.3)
will_paginate (3.0.pre2)
and my Gemfile is
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'mysql'
gem 'devise'
gem 'thinking-sphinx', '2.0.0', :require => 'thinking_sphinx'
gem "paperclip", "~> 2.3"
gem "will_paginate", "~> 3.0.pre2"
any ideas...it was working fine till today
Try including tzinfo-0.3.24 in your Gemfile and doing bundle exec with the command that gives you the error. Alternatively you could bundle install --development to get the Gems in the vendor folder. Let us know how you get on.
After DLL Hell we have Gem Hell. It looks like we have the same dependency hell in Ruby as in other communities. Welcome :-)
The gem tzinfo with the right version 0.3.24 seems to be missing, or it is not referenced correctly in your Gemfile. Check your Gemfile and your Gemfile.lock. The latter is useful to find out dependencies, and it should be updated if the Gemfile is changed (by running a bundle install).
If you have installed the gems locally, by using gem install --user-install gemname or bundle install --path ~/.gem, then you maybe have multiple gems in multiple locations. Check out the GEM PATHS by calling a gem env command from the command line.
And by the way, you seem to use Rails 3.0.x with the old mysql gem. The mysql2 gem is now the default in Rails 3. I would recommend to use the mysql2 gem instead by adding gem 'mysql2' to the GemFile and by using using the mysql2 adapter in your database.yml.