I am having issues with generating templates from Rails


#1

So, it is the fourth time for today that I try to complete the ‘my first rail application’ part of the project. The 3 other times I got stuck in the last commands by an error saying there is no repository for the heroku deployment.
Now I am stuck and having an error with generating the templates…
1st try I got this error in the end of the generated text: Could not find pg-1.1.4 in any of the sources (Bundler::GemNotFound)

2nd try I want to change gem ‘sqlite3’ to gem ‘sqlite3’ , ‘~> 1.3.13’, but it is already like that. I got this: An error occurred while installing pg (1.1.4), and Bundler cannot
continue.
Make sure that gem install pg -v '1.1.4' --source 'https://rubygems.org/'
succeeds before bundling.

3rd try I change gem ‘sqlite3’ , ‘~> 1.3.13’ to gem ‘sqlite3’, ‘~> 1.3.6’ and I get this: [!] There was an error parsing Gemfile: syntax error, unexpected ‘~’, expecting do or ‘{’ or ‘(’ - gem ‘sqlite3’, ‘~> 1.3.6’
^
/home/meni/odin_on_rails/my_first_rails_app/Gemfile:11: unexpected fraction part after numeric literal
… gem ‘sqlite3’, ‘~> 1.3.6’
… ^~~. Bundler cannot continue.

from /home/meni/odin_on_rails/my_first_rails_app/Gemfile:11

-------------------------------------------

group :development, :test do

 gem ‘sqlite3’, ‘~> 1.3.6’

end

-------------------------------------------

Please help me I don’t know what try anymore :frowning: and I really cannot be calm until I solve this .
Thanks in advance :love_you_gesture:


#2

Please post your full Gemfile contents.


#3

I am not allowed to post more than two lines of code because I am a new bee.


#4

You can use https://pastebin.com/ to paste long lines of code and share a link to it.


#5

Thanks a lot :slight_smile:


#6

So I started from the beginning and this time I had no problems but this is what I get when I am supposed to see my application: https://pastebin.com/UJNK64EJ
And then I am supposed to try out if the app runs by creating new cars but I am not sure this is working even :confused:
Also this is the Gemfile content: https://pastebin.com/yDSZdYsC


#7

The solution is here.

Basically; change the line in the Gemfile gem ‘sqlite3’ to gem ‘sqlite3’, ‘~> 1.3.6’, save the file, and run ‘bundle install’ again.


#8

done! This is what I get after bundle install:https://pastebin.com/Sdhx0wVL
and again the same problem with the app page :confused:


#9

I can see an error related to postgres (gem pg), and I can see 2 production groups in your Gemfile, both with the pg gem, which seems weird (wrong).

Try deleting one of those production groups from your Gemfile, and then running bundle install again.

I have just noticed you have this, too:

group :development, :test do
group :development, :test do
gem 'sqlite3' , '~> 1.3.13'
end

group :production do
gem 'pg'
end

end

So you also have 2 development groups, (with the extra production group nested inside it).

You need one production group and one development group, and no duplication of gems.

Try rewriting the above to:

group :development, :test do
gem 'sqlite3' , '~> 1.3.13'
end

make sure you 1 production and 1 development group, then run bundle install again.


#10

Thank you very much for helping me :slight_smile: You were wonderful :slight_smile: Everything you said now worked out :slight_smile:


#11

Hoorah! Well done for sticking with it. Rails can throw many confusing errors when you are new to it. :grin::+1:


Help needed - git push heroku master - errors on this part