File to import not found or unreadable: bootstrap. Michaeal harts tutorial

103 views
Skip to first unread message

Roelof Wobben

unread,
Jul 16, 2014, 3:52:44 AM7/16/14
to rubyonra...@googlegroups.com
Hello,

Im following Micheal harts tutorial.
On chapter 5 you have to change the custum.css.scss file.

But when I do rails s I see the above error.

You can find all the sources here :  https://github.com/roelof1967/sample_app

Roelof

Colin Law

unread,
Jul 16, 2014, 5:07:04 AM7/16/14
to rubyonra...@googlegroups.com
You have not added bootstrap to Gemfile as described in listing 5.3

Colin

Roelof Wobben

unread,
Jul 16, 2014, 7:41:27 AM7/16/14
to rubyonra...@googlegroups.com
Thanks.

but the problem is not solved.
When I change that part to this :

gem 'rails', '4.1.4'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sprockets', '2.11.0'

I see this error when running rails s

/var/lib/gems/1.9.1/gems/bootstrap-sass-2.3.2.0/lib/bootstrap-sass.rb:14:in `require': cannot load such file -- sass-rails (LoadError)
    from /var/lib/gems/1.9.1/gems/bootstrap-sass-2.3.2.0/lib/bootstrap-sass.rb:14:in `load!'


After adding sass-rails to the gem file I see this error  when doing bundle install :

Bundler could not find compatible versions for gem "sprockets-rails":
  In Gemfile:
    sass-rails (>= 0) ruby depends on
      sprockets-rails (~> 2.0.0) ruby

    rails (= 4.1.4) ruby depends on
      sprockets-rails (2.1.3)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    sass-rails (>= 0) ruby depends on
      railties (~> 3.1.0) ruby

    coffee-rails (= 4.0.1) ruby depends on
      railties (4.1.4)




Op woensdag 16 juli 2014 11:07:04 UTC+2 schreef Colin Law:

Colin Law

unread,
Jul 16, 2014, 8:50:19 AM7/16/14
to rubyonra...@googlegroups.com
On 16 July 2014 12:41, Roelof Wobben <rwo...@hotmail.com> wrote:
> Thanks.
>
> but the problem is not solved.
> When I change that part to this :
>
> gem 'rails', '4.1.4'
> gem 'bootstrap-sass', '2.3.2.0'
> gem 'sprockets', '2.11.0'
>
> I see this error when running rails s
>
> /var/lib/gems/1.9.1/gems/bootstrap-sass-2.3.2.0/lib/bootstrap-sass.rb:14:in
> `require': cannot load such file -- sass-rails (LoadError)
> from
> /var/lib/gems/1.9.1/gems/bootstrap-sass-2.3.2.0/lib/bootstrap-sass.rb:14:in
> `load!'

You have confused Gemfile.lock by putting in sass-rails and then taking it out.

>
>
> After adding sass-rails to the gem file I see this error when doing bundle
> install :
>
> Bundler could not find compatible versions for gem "sprockets-rails":
> In Gemfile:
> sass-rails (>= 0) ruby depends on
> sprockets-rails (~> 2.0.0) ruby
>
> rails (= 4.1.4) ruby depends on
> sprockets-rails (2.1.3)


Go back to the most recent working version of your app in your git
repository and just make the changes from the tutorial again, that
should sort it. That is why git (and similar tools) are so valuable.
Any time you mess things up you can easily get back to a working
system.

For anyone else who finds this and has not been using a Source Control
System then probably the best solution would be to revert Gemfile to
*exactly* what it should be as required by the tutorial, delete
Gemfile.lock and run
bundle install
again. Hopefully That will regenerate the correct Gemfile.lock.

Colin
Reply all
Reply to author
Forward
0 new messages