I'm new to Rails. I am making my way through literature and have just stumbled across the 'rails console' command.
When I type that in, I get:
Loading development environment (Rails 3.0.7)
In turn, the development environment never loads. I've waited quite a few minutes, too.
I did see some of the other related posts to this topic/problem, but in all instances, it seemed that individuals were trying to speed up their environment load time -- not simply get their environment to load in the first place.
As for my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.7'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', '1.3.1', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
Just update your bundler, it may be of any of the older gems is conflicting with latest one, this type of issues arises.
'gem install bundler'
and then 'bundle install'
If you find again error, then delete the Gemfile.lock file, then run bundle install. It may resolve the issue.
I would install RVM and not use the built in Ruby etc.
Install RVM
Related
I get the following error: Gemfile Syntax Error.
Here is my code:
source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'devise'
# Bundle bootstrap gems
group :development do
gem 'thin'
# 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.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
You're missing an end for the do in group :development. Add an end statement on the line after gem 'sqlite3'.
You can run ruby -c Gemfile to check the syntax (it's regular Ruby code), and it'll give you an idea of where the error lies.
It looks like you are missing a end after the development group.
I encountered the error several times, but I didn't touch the file generated by rails and ruby -c Gemfile says syntax is Ok. In my case, if rails command can not be found, Gemfile syntax error might be reported.
I use brew+rbenv+ruby 2.0+rails 4 and I use the following commands to get things back to normal.
# new commands in brew-installed ruby might not be linked automatically
brew unlink ruby && brew link ruby
# fix "gem" itself
sudo gem update --system
# after installing executable with rbenv, you need rehash
rbenv rehash
I'm trying to upload my rail app to Heroku. I'm using Ruby 1.9.3.
The app can be deployed okay on my local machine.
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
I've tried entering this line to the Gemfile
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
But it doesn't seem to solve the problem.
Can someone please advise ? Thank you in advance for the help.
p.s.: Really sorry for the newbie question, I'm pretty new at Ruby on Rails development.
Below is my complete Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# for Heroku deployment - as described in Ap. A of ELLS book
group :development, :test do
gem 'sqlite3'
gem 'ruby-debug19', :require => 'ruby-debug'
end
group :production do
gem 'pg'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'therubyracer'
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 'haml'
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
linecache19 is a gem used for debugging purposes. There is no need for it in production, so you should be excluding it from the gems used in production.
Add it to the :development, :test group you already have toward the top of your file, bundle, and re-deploy.
group :development, :test do
gem 'sqlite3'
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
end
I'm trying to upgrade all my apps from ruby 1.8.7 to 1.9.3.
Some apps are working fine. However, I have a rails 3.0.x site that keeps throwing an error about the wrong bundler version when I run it or use bundle install.
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
refinerycms (~> 0.9.8.5) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.2.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
I have both bundler 1.2.3 installed (required for passenger) and bundler 1.0.22. However, it wont let me run bundle install, and running the site also throws an error that rails 3.0 requires the older version of bundler.
UPDATE:
I got my gems installed using the older version of bundler:
bundle _1.0.3_ install
This worked fine as far as installing gems, however when i run the site, Passenger still complains that i'm using bundler 1.2.3 and it needs (~>1.0.0). Doesn't ~> mean "greater than 1.0" ? I don't have any of these problems under Ruby 1.8.7.
Here is my Gemfile. As you can see, I have tried including the older version of bundler in my gemfile and excluding. Neither way works. :(
source 'http://rubygems.org'
#gem 'bundler', '1.0.3'
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2', '0.2.6'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
# REFINERY CMS ================================================================
# Specify the Refinery CMS core:
gem 'refinerycms', '~> 0.9.8.5'
# Specify additional Refinery CMS Engines here (all optional):
gem 'refinerycms-inquiries', '~> 0.9.8.10'
gem 'refinerycms-search', '~> 0.9.8'
gem "refinerycms-news", '~> 0.9.9'
# Add i18n support (optional, you can remove this if you really want to).
gem 'refinerycms-i18n', '~> 0.9.8.7'
# Figure out how to get RMagick:
rmagick_options = {:require => false}
rmagick_options.update({
:git => 'git://github.com/refinerycms/rmagick.git',
:branch => 'windows'
}) if Bundler::WINDOWS
# Specify a version of RMagick that works in your environment:
gem 'rmagick', '~> 2.12.2', rmagick_options
# END REFINERY CMS ============================================================
# USER DEFINED
# END USER DEFINED
gem 'validates_timeliness', '~> 3.0.0'
engine_path = File.join(File.dirname(__FILE__), 'vendor/engines')
#puts engine_path
gem 'refinerycms-venues', '1.0', :path => "./vendor/engines", :require => 'venues'
gem 'refinerycms-events', '1.0', :path => './vendor/engines', :require => 'events'
gem 'refinerycms-available_spaces', '1.0', :path => './vendor/engines', :require => 'available_spaces'
gem 'refinerycms-contents', '1.0', :path => 'vendor/engines', :require => 'contents'
gem 'refinerycms-news_alerts', '1.0', :path => 'vendor/engines', :require => 'news_alerts'
Its like Rails 3.0 will NOT allow me to run the site if i have a newer version of bundler installed, but that seems insane. Would having a newer version of bundler break older sites?
i got this error while i try to start the webrick server on my windows xp.
←[31mCould not find eventmachine-0.12.10 in any of the sources←[0m
←[33mRun `bundle install` to install missing gems.←[0m
I've already did a 'bundle install'. Also tried to install mongrel but it's not helping!
Gemfile codes:
source 'http://rubygems.org'
gem 'rails', '3.0.10'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'sqlite3'
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
gem 'thin'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
Try running these commands and then try rails s again.
gem install specific_install
gem specific_install -l http://github.com/eventmachine/eventmachine.git
My Gem file looks like this:
source 'http://rubygems.org'
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'sqlite3-ruby', :require => 'sqlite3'
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
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
I get that error message when I try to go to /pages/home.
I am following the railstutorial guide and am at this point: http://railstutorial.org/chapters/static-pages#code:pages_routes
Btw, I am using sqlite3 as my db for now - if you were wondering.
Any ideas?
Edit: When I load the page, I am seeing a windows error message that says "ruby.exe - Entry point not found: The procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll".
Then it shows the error message in the browser.
I just had this issue on a windows vista system and got it working by downloading the precompiled binaries for windows from the sqlite website:
http://sqlite.org/download.html
once I downloaded the shell and the dll (I would have posted the links directly but this site will only allow me to post 1!!!) to my desktop I extracted them to the C:\Ruby192\bin folder and then ran:
gem install sqlite3-ruby
from the command line.
My issue is now fully resolved. Hope that helps.
I fixed this by re-creating my app, and in the initial bundle install, I changed the gem file to just have:
gem 'sqlite3-ruby', :require => 'sqlite3'
and not:
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
This seems to work. For whatever reason, that version of sqlite3 was not agreeing with my setup.